I’m trying to replicate some logic we currently handle in our Kotlin Android app directly inside CXone Studio. The goal is simple: check if a custom attribute exists, set a flag, and route based on that flag.
The problem is the IF action seems to be evaluating the variable before the ASSIGN action actually commits the value. Or maybe I’m misunderstanding the execution order in the flow.
Here is the snippet:
- ASSIGN Action:
target_variable= “is_priority”
- Value:
IF(GET("custom_attributes.priority_level") == "HIGH", "true", "false")
- IF Action:
Condition:target_variableequals"true"
- True Path: Route to Premium Queue
- False Path: Route to Standard Queue
When I trace the call in the logs, the custom_attributes.priority_level is definitely “HIGH”. The ASSIGN action logs show it setting target_variable to “true”. But the IF action consistently takes the False path.
I’ve tried adding a WAIT action for 1 second between them, but that feels like a hack. Is there a specific way to force the variable state to persist before the next node evaluates? The documentation is pretty sparse on variable scoping within the same flow step.