Trying to set up some branching logic in a Studio snippet based on a custom attribute. The attribute cust_type is coming through as a string, and I need to route based on whether it’s ‘VIP’ or ‘Standard’.
Here’s the setup:
ASSIGN var.temp_type = GETCUSTOMATTRIBUTE("cust_type")
IF var.temp_type == 'VIP'
ASSIGN var.route = 'vip_queue'
ELSE
ASSIGN var.route = 'std_queue'
ENDIF
The problem is the IF condition always evaluates to false, even when I log var.temp_type and it clearly shows “VIP”. I’ve tried trimming the value with TRIM() just in case there’s hidden whitespace, but that didn’t help. I also tried using EQUALS() instead of ==, same result.
Is there a specific way to handle string comparisons in these snippets? Or am I missing something obvious about how the attribute is being passed? The docs are pretty light on examples for this specific pattern.