Trying to get a simple conditional branch working in a CXone Studio script. The goal is to route based on a custom attribute customer_tier returned from a previous proxy call.
I have the following snippet:
{
"Assign": {
"Target": "customer_tier",
"Value": "{{GetRESTProxy.Response.customer_tier}}"
},
"If": {
"Condition": "{{customer_tier}} == 'Gold'",
"True": "Route_Gold",
"False": "Route_Silver"
}
}
The call returns 200 OK and the JSON payload clearly shows "customer_tier": "Gold". I added a debug log right after the Assign action and it prints Gold. But the If action always goes to Route_Silver.
I tried changing the condition to {{customer_tier}} contains 'Gold' but that didn’t help either. The docs say string comparison is case-sensitive, which I am aware of. Is there a whitespace issue or something else I am missing? The variable seems to be set correctly but the logic never evaluates to true.