I’m using an iterator to aggregate N sub-objects into a single JSON object that will be sent as a string in a single API call. The sub-objects are named “tempX_audio” (X is sequential from 1 to N) and they’ll contain the same fields. Just note the API won’t accept an array - the sub-objects must be fields in a parent object. Desired output format is:
{
"temp1_audio": {
"robot": "z",
"url": "y"
},
"temp2_audio": {
"robot": "z",
"url": "y"
}
...
}
N varies with each execution, but will be known for each execution when the iterator starts.
I have tried string aggregators after the iterator is closed by an array aggregator (gets an array, but not a collection). I’ve tried building a string variable within the iterator loop (kept getting missing value error). I’m pretty new to Make.com and cannot figure out what must be a straightforward pattern to add dynamically named fields to a collection.
Guessing I need a pattern for this: within an iterator loop, sequentially add a module’s output bundle to a single collection, dynamically naming the field with the current iteration. Then, convert the whole collection to a string.
How can I do this? Thanks!