How to I formulate input for Iterator

meltingsand

Member
I have some data which Chat GPT is outputting in this format:
[
{"Category" : "Home", "Task" : "Wash Car", "Date" : "Feb 23, 2025"},
{"Category" : "Church", "Task" : "Send new report to the Bishop", "Date" : ""}
{"Category" : "Work", "Task" : "Email new client data", "Date" : "Feb 28, 2025"}
]
This seems like a valid array format, but when I make the output non simple it puts everything in one variable like this: https://share.zight.com/eDubJ7A5
If I feed it to Iterator in that format it just puts the whole array in a single field like this: https://share.zight.com/OAudejEN

How should I alter the output format so it can be parsed by Iterator and loop through one element at a time?

You can check this out in my account: [email protected]
 

ArshilAhmad

Well-known member
Staff member
Hi @meltingsand,

Could you please share the Workflow URL where you have this concern?

Also, the output you shared appears to be missing a comma, which makes it an invalid JSON.

1740935153873.png


1740935288717.png
 

Preeti Paryani

Well-known member
Staff member
Hello @meltingsand,

Upon reviewing, we noticed that the ChatGPT response contains nested arrays. An Iterator was already added to process the array received from the ChatGPT step. To further refine the handling, we have now added another Iterator to map the required array from the previous Iterator's response.

Please refer to the attached images for more details. We recommend running a few tests after verifying the mapping of all steps. Let us know if everything works as expected.

1741082293729.png


1741082300267.png


1741082311091.png
 
Top