Studio IF action failing to evaluate string comparison against WFM adherence data

Hey folks,

I’m trying to build a simple Studio flow that checks an agent’s current adherence status before routing a call. I’m pulling the data from our internal WFM dashboard endpoint, which returns a JSON payload with a status field. The goal is to branch the flow: if the status is "compliant", route to the normal queue. If it’s anything else, drop to voicemail.

The problem is the IF action keeps evaluating to false even when I hardcode the expected value for testing. I’ve double-checked the spelling and case sensitivity. Here’s the snippet I’m using:

ASSIGN status = GetRESTProxy("wfm_dashboard").response.body.status

IF status == "compliant"
 GOTO "Normal Route"
ELSE
 GOTO "Voicemail"
END IF

I added a Log action right after the ASSIGN to see what’s actually coming back. The log shows status = compliant (no quotes, just the raw string). But the IF block still sends it to the ELSE path.

I’m wondering if the GetRESTProxy is returning the value as an object or if there’s some hidden whitespace. I tried trimming it with TRIM(status) but that didn’t help. Also, I’m not sure if the == operator works for string comparison in Studio or if I need a different syntax.

Has anyone run into this before? I’m stuck on why the comparison is failing when the log output looks correct.

Hey folks,

Studio’s string handling can be a little tricky when dealing with external data. The problem isn’t usually the IF block itself, but how you’re accessing the value. If your GetRESTProxy action is returning a raw JSON string, you’ll need to parse it first.

Try adding a “Parse JSON” action before your IF. Set the input to the body from your HTTP request and define the JSON schema. Then, in your IF condition, reference the parsed object path instead of the raw string - something like $.status.

If you’re already parsing it, double-check for hidden whitespace. CXone doesn’t trim strings automatically. Try wrapping the value in a trim() function within the expression editor: trim($.status) == "compliant".

Also, verify the HTTP action is actually returning application/json. If it’s text/plain, the parser might fail silently. Dig into the debug logs to see the actual payload structure. I’ve spent hours troubleshooting this exact setup.

1 Like