I’m trying to implement branching logic in a CXone Studio snippet. The goal is to check if a custom field is_premium is set to true, and if so, route to a specific queue. Otherwise, it should fall through to the default IVR.
Here is the snippet logic I’ve built:
ASSIGN: local.is_premium = contact.custom_attributes.is_premium
IF: local.is_premium == true
THEN: Set queue to 'Premium Support'
ELSE:
Continue to IVR
The issue is that the IF condition always evaluates to false, even when I manually set is_premium to true in the console before the call connects. I’ve verified the field exists and is populated.
I suspect the ASSIGN action might not be pulling the value correctly or there’s a type mismatch. The contact.custom_attributes.is_premium returns a string 'true' but the comparison uses a boolean true.
Should I be converting the string to a boolean first using another action? Or is there a specific way to handle string comparisons in Studio IF actions? I’ve tried local.is_premium == 'true' but it still fails to branch. Any ideas on what I’m missing?