Hey team,
I’m trying to iterate over a list of items returned from a custom Data Action in Architect. The Data Action calls an external API and returns a JSON array of objects. I want to process each item in the array and update a contact attribute for each one.
Here is the JSON response from the Data Action:
[
{ "id": "1", "name": "Item 1" },
{ "id": "2", "name": "Item 2" }
]
I’ve set up a Loop block in Architect, but I’m not sure how to configure it to iterate over this array. The Loop block requires a start index, end index, and increment. How do I map these values to the JSON array?
I tried setting the start index to 0, the end index to the length of the array, and the increment to 1, but the loop doesn’t seem to execute correctly. The contact attributes aren’t being updated.
Here is the Loop block configuration:
{
"start": 0,
"end": {{json.length}},
"increment": 1
}
Any ideas on how to correctly set up the Loop block to iterate over a JSON array in Architect? I’ve searched the documentation but haven’t found a clear example. Thanks for the help!