I’m trying to parse a JSON response from a GetRESTProxy call in a CXone Studio snippet. The goal is to extract a status code and branch based on it.
Here is the snippet logic:
{
"name": "ParseResponse",
"actions": [
{
"type": "ASSIGN",
"key": "statusCode",
"value": "${response.body.status}"
},
{
"type": "IF",
"condition": "${statusCode} == '200'",
"trueBranch": "Success",
"falseBranch": "Error"
}
]
}
The problem is that the IF condition always evaluates to false, even when response.body.status is clearly '200' in the debug logs. It seems like statusCode isn’t being set correctly or the IF block doesn’t see the variable from the previous ASSIGN action in the same list.
Is there a specific way to handle variable dependencies in Studio snippets? Or do I need to use a different syntax for the condition? I’ve checked the documentation but it’s vague about execution order within a single action array.