Parsing JSON Arrays in Architect

I have twelve years of experience in the contact center industry and I am currently architecting a solution for a ConvergeOne client. We are utilizing a custom Data Action to retrieve a list of pending orders from a backend ERP. The API returns a nested JSON array of order objects. I am struggling to map this array into Architect variables. Architect variables appear to be flat. Is there a way to iterate through a JSON array returned by a Data Action within a Task, or must we flatten the entire response in the Data Action’s Translation Map before it returns to the flow?

Good afternoon. We handle similar data structures in our MuleSoft and Kafka integrations. You are correct that Architect variables are primarily flat.

The standard enterprise approach is to utilize the ‘JSONPath’ expressions within your Data Action’s ‘Response Template’. You can use the Translation Map to extract specific indices from the array.

However, if you need to iterate through the entire list within Architect, you must use a ‘Loop’ block. You will need the Data Action to return the count of items and then use a variable to access the elements by index, such as Task.Orders[Task.Index].

It requires a bit of Java-like logic but it is very robust.

The previous point about indexing is correct. If the data set is very large, I recommend using an iPaaS solution like Workato to pre-process the data. We frequently see clients struggle with complex array parsing inside Architect because it can lead to very cluttered flow designs.

By using a middleware to transform the nested ERP response into a simplified, flattened JSON object or even a comma-separated string, you can greatly reduce the complexity of your Architect variables. This makes your analytics and reporting much more reliable since the data is cleaner when it enters the platform.