Need a quick sanity check on my Studio logic. I’m pulling a JSON payload from a custom DFO webhook and trying to branch based on a nested field.
The incoming payload looks like this:
{
"data": {
"intent": "billing",
"priority": 1
}
}
I’m using a GetRESTProxy action to fetch the data, then an ASSIGN action to map it to a global variable g_payload. The assign works fine. I can see the value in the debug log.
The problem is the IF action. I’m trying to check if g_payload.data.intent equals “billing”. The condition always evaluates to false, even when the intent is clearly “billing”. I’ve tried referencing the variable as g_payload['data']['intent'] and g_payload.data.intent. Both fail.
Is the IF action unable to parse nested JSON objects directly? Do I need to flatten this with another ASSIGN before checking? Here’s the current IF config JSON:
{
"actions": [
{
"type": "IF",
"condition": {
"left": "g_payload.data.intent",
"operator": "EQUALS",
"right": "billing"
},
"trueBranch": "route_billing",
"falseBranch": "default_route"
}
]
}
The debug log shows g_payload is a string representation of the JSON, not a parsed object. If that’s the case, how do I access the nested fields in the IF condition without writing a full script action?