Loop block iteration over Data Action JSON array

Stuck on mapping a JSON array from a custom Data Action in Genesys Cloud Architect. My Data Action returns a valid list of objects via GET /api/v2/custom-objects/instances. I have configured the Loop block to iterate, yet the subsequent Set Data block fails to resolve the current item’s properties. The JSON payload is standard, but the iterator seems to treat the whole array as a single string. Is there a specific schema requirement for the Data Action output to be recognized as iterable by the Loop block? Here is the response structure: {“items”: [{“id”: 1, “name”: “test”}]}. How do I correctly reference the current loop item in the mapping?

The quickest way to solve this is to ensure your Data Action explicitly returns the items array rather than the full response envelope. The documentation explicitly states, “When iterating over custom object instances, the loop must target the collection property, not the root object.” If you pass the entire JSON response, the iterator treats it as a single opaque string. You need to configure your Data Action’s output mapping to extract response.items into a clean array variable before passing it to the Loop block.

Your Set Data block inside the loop likely fails because the schema definition does not match the incoming item structure. Define the loop variable as an array of objects with specific keys. For example, if your object has id and name, ensure the loop iterator is typed as Array<Object> with those fields defined. This forces the engine to parse each element correctly instead of attempting string concatenation on the raw JSON.