Hey folks,
Trying to build a Data Action that calls an external REST endpoint and maps the response back to Architect variables. The API returns a JSON object with a nested array, and I’m hitting a wall on how to reference those items in the mapping step.
Here’s the response structure I’m getting back from the GET request:
{
"status": "success",
"data": {
"customerId": "12345",
"preferences": [
{
"type": "email",
"value": "john@example.com"
},
{
"type": "phone",
"value": "555-0199"
}
]
}
}
The Data Action runs fine and I can see the full JSON payload in the debug log. I can map data.customerId to a string variable without issue. But when I try to map data.preferences[0].value to another variable, the mapping fails silently or just returns null.
I’ve tried using dot notation, bracket notation, and even flattening the JSON beforehand with a script task, but nothing seems to stick in the Data Action output mapping.
Is there a specific syntax for accessing array elements in the Data Action JSON mapping schema? Or do I need to iterate through the array in a separate step before mapping?
Here’s the relevant part of my Data Action JSON definition:
{
"request": {
"method": "GET",
"url": "https://api.internal.com/v1/customer/{{customer_id}}"
},
"output": {
"customer_id": "$.data.customerId",
"primary_contact": "$.data.preferences[0].value"
}
}
Any pointers would be appreciated.