Running into a weird issue with the Set Participant Data action in Architect. I’m setting a custom variable cust_id via an API response mapping, but when I try to use it in the next action, it’s null. I’ve checked the JSON mapping syntax and it looks right. Is there a scope issue here? The payload comes through fine on the webhook side. Anyone seen this?
It’s likely a scope issue, but specifically with how the data is being mapped in the first place. You mentioned the payload comes through fine on the webhook side, which is good. The problem usually isn’t the variable name itself, but where it’s sitting in the JSON structure when Architect tries to read it.
Architect doesn’t just look for cust_id at the root level of the response body. If your API returns something like {"data": {"cust_id": "123"}}, you need to map it explicitly to that path. If you leave the mapping blank or just put cust_id, Architect looks at the root and finds nothing.
Try this in your Set Participant Data action:
- Go to the Value field.
- Select API Response as the source.
- In the JSON Path field, enter
$.data.cust_id(adjustdatato whatever the parent key is in your actual response).
Also, check the scope. Make sure the action is set to Participant Data and not Conversation Data unless you specifically need it to persist across all legs of the interaction. If you’re switching between the two, the variable won’t carry over.
If the JSON path is correct and the scope is right, check the Timing. If the Set Participant Data action runs before the API call actually completes, it’ll grab null. Ensure the API action is set to Wait for Response and that the Set Participant Data action is downstream of it in the flow.
Here’s a quick example of what the mapping should look like in the JSON path editor:
$.data.cust_id
If your response is an array, you’d need $.data[0].cust_id. It’s a tiny detail but it breaks things every time.