Loop block not iterating over Data Action JSON array

Quick question about the Loop block behavior in Architect. I am fetching a JSON array from a custom Data Action using the /api/v2/analytics/conversations endpoint. The response is valid, but the Loop block treats it as a single object instead of iterating. Here is the snippet I am using in the Data Action mapping: ASSIGN output = GetRESTProxy('GET', '/api/v2/analytics/conversations', headers);.

The JSON payload looks correct with a conversations key containing an array. Should I be mapping the loop source to a specific nested property, or is there a syntax issue with how the Loop block consumes the Data Action output? I have verified the token scope is analytics:read.

I’d suggest checking out at the specific structure returned by the analytics endpoint. The issue is likely that GetRESTProxy returns the entire response object, not just the array. The Loop block expects an array at the top level of the variable you pass to it. If you pass the wrapper object, it sees one item (the object itself).

docs state “Loop iterates over the elements of an array.” so you must isolate the array first.

I faced this exact issue with my Data Action timeout handling. The solution is not in the Loop block configuration but in how you extract the data before the Loop. You need to use the Data Action’s output mapping to extract the conversations field specifically, or handle it in Architect if the Data Action cannot be changed.

If you are stuck with the current Data Action setup, try this in the Loop block’s “Input Array” field instead of just output:

{
 "inputArray": "output.conversations",
 "currentItem": "conversationItem"
}

Wait, that is not valid Architect expression syntax for the UI input. In the Architect UI, for the Loop block, you set the “Array Variable” to the variable holding the array. If your Data Action sets output to the whole JSON, you cannot loop directly. You need to change the Data Action to set the output variable to response.conversations.

Here is the corrected Data Action mapping logic:

{
 "outputMapping": {
 "contactList": "response.conversations"
 }
}

Then in the Loop block, set the Array Variable to contactList.

If you cannot change the Data Action, you might be out of luck because Architect expressions do not support deep path extraction like output.conversations directly in the Loop source selector in all versions. I tried ASSIGN temp = output.conversations in a Set Variable block before the Loop. It failed. The docs do not specify if Set Variable supports object property access.

Use the Data Action output mapping to flatten it. This is the only reliable way I found.