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.

Yeah, Studio’s string handling is a bit finicky with external JSON. The issue isn’t usually the IF block itself, but how you’re referencing the value. If your data action returns a raw JSON string, you 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 schema. Then, in your IF condition, reference the parsed object path, not the raw string. It should look something like $.data.status.

If you’re already parsing it, check for hidden whitespace. Genesys doesn’t trim strings automatically. You might want to wrap the value in a trim() function within the expression editor: trim($.data.status) == "compliant".

Also, verify the HTTP action is actually returning application/json. If it’s text/plain, the parser might choke silently. I’ve wasted hours on this exact setup. Check the debug logs for the actual payload structure.