Unable to access REST call response after decision in microflow

0
I'm trying to handle a bad request response (status code = 400) after calling a REST API in a microflow using a decision activity. I want to display the success and error message returned by the API call. Here's the issue: after a decision activity, I try to access the variable "CheckMultipleShipErrorResponse" in a Change Object activity, but it shows an error "Unknown variable 'CheckMultipleShipErrorResponse'. Perhaps the variable is not in scope."   My microflow looks like this: - Create object with output named "NewCheckShippingError" - Call a REST activity to send a request (response is stored as variable "CheckMultipleShipErrorResponse") - Use a decision activity to handle the response - 1st Change an object (input object is my domain model) - 2nd Change an object (input object is the output of Create Object: "NewCheckShippingError") - End event   My domain model is set up with a variable for the API response "ResponseBody", which is currently a string. However, when I try to access this variable by setting value to REST response variable "CheckMultipleShipErrorResponse", I get an error message. Could someone please help me understand where I'm going wrong? Additionally, I'm unsure why I need both Change Object activities - couldn't I just use the second one?   Microflow:   Call REST activity response:   Decision:   1st Change Object activity:   2nd Change Object activity:   End event:   My domain model:   Thank you.
asked
1 answers
1

Would it help if there were a separate path for error handling on the REST call? As you are capturing the error in the $latestHTTPResponse this will be sometimes available but sometime it won't be available as there isn't an error and thus the $CheckMultipleShipErrorResponse is available. 

If you make the error handler separate this will the only store the $latestHTTPRespone in the 'error' path and the 'happy' path will contain the $CheckMultipleShipErrorResponse variable. 

answered