Loop block throws Invalid JSON when iterating over the response payload from a custom Data Action.
{
"entities": [
{"id": 1, "status": "active"},
{"id": 2, "status": "pending"}
]
}
- Set Loop input to
dataActionResult.entities and verified the path resolves correctly in debug mode.
- Changed the external service response to a flat array instead of an object wrapper, but the Loop block still refuses to iterate.
What is the expected input format for the Loop block when consuming external JSON?
It depends, but generally… The Loop block expects a raw array, not an object. Your Data Action returns { entities: [...] }, so dataActionResult.entities is correct, but Architect might be choking on the wrapper if the schema isn’t strictly defined. Try mapping the response in the Data Action config to output just the array. Or, use a Set Data action to explicitly assign dataActionResult.entities to a new variable myArray, then loop over myArray. I’ve seen this fail when the JSON content type header is missing application/json in the external response. Check the headers first.