Hi @Alex15
Here is a lazy method I used after I tried all these solutions and they didn’t work for me.
I had a similar issue where I wanted to iterate through several bundles containing urls returned from Airtable. Due to the nature of my automation, it is impossible to know in advance what the number of fields is, and my key names could alternate between 2 possible values.
(only one key name value is shown here)
My use case was to loop through the URLs to create a new JSON object that would contain the links and a method.
So, what I did was to use the array aggregator to convert it into a list:
Then used the Transform to JSON module to convert it to a JSON string;
Finally, I passed this JSON string to ChatGPT with a prompt to format it in my desired format. I gave it an example of the outcome, and I had to give specific instructions. For example, I asked it not to add language tags (it was adding ‘’‘json {{the JSON object}}’‘’) to the output and just return it as is.
The output:
The output has been consistent so far and I have no complaints.
One thing I would be mindful of is the token limits if your dataset is particularly large. You might want to truncate the retrieval.
Goodluck.