Create JSON from an Array with 2 collections

Hello! I’m new to make.com
I am trying to use make.com to create multiple videos using creatomate, then stitch them together at the end.

To stitch the videos, I need a list of all the URLs of the generated videos from previous steps. I have to send that as a JSON payload to creatomate.

MY GOAL NOW: gather all of the URLs of the videos generated by creatomate, so I can build the JSON payload.

MY PROBLEM: I cant’t figure out how to create a JSON that uses the URL values from the output of the previous array aggregator as input (see screenshot). This array can vary in size. I don’t care about the array particularly, I just need a way to collect all of the URLs from the creatomate step and feed them into my JSON creation step.

I am also attaching my blueprint.

Hello! I’m new to make.com
I am trying to use make.com to create multiple videos using creatomate, then stitch them together at the end.

To stitch the videos, I need a list of all the URLs of the generated videos from previous steps. I have to send that as a JSON payload to creatomate.

MY GOAL NOW: gather all of the URLs of the videos generated by creatomate, so I can build the JSON payload.

MY PROBLEM: I cant’t figure out how to create a JSON that uses the URL values from the output of the previous array aggregator as input (see screenshot). This array can vary in size. I don’t care about the array particularly, I just need a way to collect all of the URLs from the creatomate step and feed them into my JSON creation step.

I am also attaching my blueprint. Note that I have a couple of steps that write to a google sheet, this is just for tracking purposes. The goal is really just to be able to use ALL the URLs generated by creatomate as input to a single JSON payload.

TY in advance!

Hello,
Try using Transform to JSON and Map URL array.

Thanks for your reply. When I do that, I only see the last item from the array:

If you need a JSON like this:

[
    {
        "URL": "url1"
    },
    {
        "URL": "url2"
    },
    {
        "URL": "url3"
    }
]

You can add a Text Aggergator module after the Creatomate module, with a comma , as separator

Then you can add it inside a [ ] on a Parse JSON module

Thank you for helping. I tried your suggestion, but the text aggregator runs them as separate operations, instead of a single operation with a single JSON text containing the 2 URLs

What am I missing to create a single JSON output containing all the URLs?

It runs twice because something behind the Creatomate module is returning 2 bundles and is connected to the Array Aggregator, to make it run once you have to connect the Array Aggregator or the Text Aggregator to that module to grab those bundles before they run one at a time

I’m not following what you mean by something behind the creatomate module.
Would you be so kind as to share a screenshot?

Hi
I managed to figure it out. For anyone else:

creatomate → array aggregator (with creatomate as source) → iterator → text aggregator (with the earlier parsed JSON step as source).

If you have the array list, use Chatgpt by creating a chat completion. You can use a prompt like this, for example:

"Create a JSON string based on this array using the following format:

[
{
“Video1url”: video 1 data
},
{
“Video2url”: video 2 data
},
{
“Video3url”: video 3 data
}

]

Welcome to the Make community!

Setting the Correct Aggregator Source

You need to set the “Source Module” field of the aggregator to where the bundles are coming from. This is usually an iterator module, but can also be a search/list/repeater module, or even the trigger module!

Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

Question: Which is the best aggregator do you think you’ll need for your use-case?

Mapping a Specific Structure Into a Complex Field

If you have an array of collections, in programming terms, this is called an array of objects, or an array with non-primitive data types (“complex”).

The Array Aggregator module is very powerful because it allows you to build a new complex array of collections that matches a later module’s field to map multiple items (collections) to it. Such fields initially would allow you to manually add items, but you can toggle the “Map” switch to the “on” state and map a whole array into a single field.

This is done by selecting the “Target structure type” in an Array Aggregator module.

As you can see from the above example, the “Map” toggle on complex fields are used when you have an array variable (like from an array aggregator). Other combinations of modules may also allow you to generate an array that matches a future field’s array structure, like “Aggregate to JSON + Parse JSON”, or “Create JSON + Parse JSON”, but this is an advanced topic.

Question: Are you mapping your array into a field that accepts more than one item/collection?

For more information, see “Mapping with arrays” in the Help Centre. You should also do the Make Academy, which also covers the use of Iterators & Aggregators.

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew