Help with parse and bundle JSONs

Hey guys, I might have a kinda dumb question, but I really don’t know how to do it.

I ask ChatGPT to generate 12 images prompts and to output in a JSON so I could Parse the JSON to have each prompt. But then, I want to send them to Leonardo.AI.

How do I make this without me having to create 12 different nodes for Leonardo AI to send them one at a time?

I’m new to make.com so I still have some basic questions. This would be to make 12 different bundles, right?

Can someone help me please?

Hi @Thiago_Torelli,
It depends a bit on the output you get from the OpenAi module and the parse JSON module. If you get separate bundles for each image prompt, you can probably use an iterator to send the bundles 1 at a time to Leonardo.
If you need further help, please provide the output bundles so we know the data structure you are trying to process.

2 Likes

I get one huge Json with each prompt in a different object. Like

promptImage1:_________
promptImage2:__________

And so on. That is why I parse it with the JSON module. But I was wondering If I can unify those parsed prompts in bundles. So it does automatic

Can you give an example output bundle of the parse JSON (you can mask any sensitive data)?
Without knowing the structure of the data, it’s difficult to give guidance and to know if the iterator is the right solution or if you need an additional step.

2 Likes

image
So this is how it comes out of chatgpt. I can’t just send this to leonardo.ai because it will understand as a whole.

I then parse it in the JSON module like this:


I now need to separate them in different bundles, don’t I?

Please provide the output bundles of the OpenAI module by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
Screenshot_2023-10-06_141025

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading them here will look like this:

module-1-input-bundle.txt (12.3 KB)
module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

Not sure if this is the best solution, but you can use the add function to join the different prompts into an array and use this as the source for the iterator:


This will generate separate bundles for processing in the Leanardo module:

2 Likes