Architect Loop block failing on JSON array from Data Action

Trying to iterate over a JSON array returned from a custom Data Action in an Architect flow. The Data Action returns valid JSON, but the Loop block seems to choke on it.

Here’s the payload:

["item1", "item2"]

I’ve mapped the Data Action output to the Loop input, but it just skips the loop body entirely. No errors, just silence. Am I missing a specific data type mapping? The documentation is thin on this.

The Loop block in Architect is notoriously picky about data types, and it’s probably not recognizing that raw JSON string as a proper array object. When you pull data from a Data Action, it often comes through as a string unless you explicitly tell the system to parse it.

You need to convert that string into an actual list object before the Loop block sees it. The easiest way to do this is by using a Set Data block with a JSON parsing expression. If your Data Action output is stored in a variable like dataActionOutput, you’d set a new variable, say parsedItems, using this expression:

json.parse(dataActionOutput)

Make sure dataActionOutput is actually the string representation of the array ["item1", "item2"]. If your Data Action is already returning a structured JSON object, you might just need to reference the specific array field within it, like dataActionOutput.items.

Once you have that parsedItems variable, map it to the Loop block’s “Items” input. The Loop block expects a list, not a string. If you skip the parsing step, Architect treats the whole JSON string as a single item, which is why the body doesn’t execute or behaves unexpectedly.

Also, check the data type of the variable you’re setting. In the Set Data block, ensure the target variable type is set to “List of Strings” or “List of Objects” depending on what’s inside your array. If it’s set to “String”, the loop won’t iterate correctly.

I’ve run into this exact issue when integrating with external APIs that return JSON strings. The json.parse() function is your friend here. It converts the string into a usable list that Architect can iterate over. Just be careful if your array contains complex objects; you’ll need to handle the property access inside the loop body accordingly.

Give that a shot. If the Loop still skips, try adding a Log block right before the Loop to print the type and length of the variable you’re passing in. That usually reveals whether the parsing happened as expected.

1 Like

The issue isn’t just the JSON string. It’s how Architect handles the output variable type from the Data Action. If the Data Action returns a string, the Loop block sees a single string value, not an array. It doesn’t auto-parse.

You need to explicitly parse it in a Set Data block before the loop. Map the Data Action output to a variable, say rawJson. Then create a new variable parsedList and set its value using this expression:

JSON.parse(getVariable("rawJson"))

Make sure the variable type for parsedList is set to List or Array in the Set Data block configuration. If you leave it as String, the loop still fails.

I ran into this last week with a similar setup. The docs don’t make it clear that you have to do this manual conversion step. It’s a common trap. Once you parse it, the Loop block will iterate correctly. Just double-check your variable types in the flow editor.