The Loop block keeps bombing out with a null reference error even though the Data Action is clearly returning an array. I’ve got a Data Action hitting our internal inventory API. The response comes back as a standard JSON array of objects. I’m trying to iterate over that array in Architect to check stock levels, but the loop never enters the body. It just skips straight to the end or throws an error depending on how I map the data.
Here’s the response payload I’m seeing in the logs:
[
{
"sku": "12345",
"count": 10
},
{
"sku": "67890",
"count": 0
}
]
I’ve tried a few things:
- Mapping the Data Action output directly to the Loop input.
- Wrapping the array in an object first using a Set Data block.
- Changing the loop type to ‘For Each’.
The documentation says it accepts an array, but it feels like it’s expecting a list type or something else entirely. The error message isn’t super helpful either. It just says “Invalid data type for iteration.” Am I missing a step in the mapping?