Studio ASSIGN action overwriting variable before IF check

Got a weird issue where my Studio flow is ignoring the IF condition. I’m setting a flag, then checking it immediately after, but it always goes to the else branch. Here’s the snippet:

ASSIGN myFlag = true
IF myFlag == true THEN
 // goes here
ELSE
 // always ends up here
END IF
  • CXone Studio v12.4
  • Variable scope is set to ‘Session’
  • Tried renaming the variable, same result
  • No error logs in the trace

Check your variable scope. Session vars can get weird if the flow forks. Try switching to Flow scope for that flag.

  • Change myFlag scope to Flow.
  • Add a Log action right after the assign to verify the value in traces.
  • Ensure no parallel paths are resetting it before the IF block.