Hi Daniel!
I had a similar situation with nested arrays in a Data Action.
When I used wildcards in the translation map, such as companies[].document and companies[].accounts[*].number, the results were returned as separate flattened collections. Because of that, the relationship between the company index and its accounts was lost.
In my case, I followed the same approach you mentioned: I returned the response as a raw string and parsed it as JSON inside Architect. This preserved the original structure and allowed me to access each company and its accounts using the correct indexes.
Another option would be to change the response structure before it reaches Architect and return a flat array containing both values, for example:
{ "document": "12345678000100", "accountNumber": 10001 }
This makes the relationship explicit, but it requires transforming the response in the source API or another integration layer.
As far as I know, the Output Contract and Translation Map alone cannot reliably preserve the parent-child relationship when both levels use dynamic nested arrays. So, for this scenario, parsing the raw JSON or normalizing the response before returning it are the safest approaches.
------------------------------
---------------------
Leticia Roque Oliveira
Senior Full Stack Developer
---------------------
------------------------------