Working on a Studio script that needs to branch based on the caller’s ID. The logic is straightforward: check if the number exists in a list, then set a flag.
Here is the snippet:
IF (sys.interaction.callingPartyNumber.value IN ["1234567890", "0987654321"])
ASSIGN setFlag = true
LOG "Flag set"
ELSE
ASSIGN setFlag = false
LOG "No match"
END IF
The script compiles fine. But when I run it, the setFlag variable remains null in the downstream actions. The LOG action fires correctly, so the IF condition is evaluating. It’s just the ASSIGN inside the block that seems to get ignored or scoped incorrectly.
The docs say: “Variables assigned within a block are available to subsequent actions in the same script.”
I’ve tried moving the ASSIGN before the IF, but then it overwrites the value. I’ve also tried using global.setFlag but that throws a syntax error in the designer.
Am I missing a scoping rule here? Or is this a known issue with the Studio engine? The environment is us-east-1.