Convert Array of collections to Array of values

I used the Array aggregator to aggregate previously identified IDs in an array.
Unfortunately, the array aggregator creates an array of collections, not IDs.

How can I convert this array of collections containing my target values (IDs) to an array of the actual target values, i.e. [ID1, ID2, ID3]?

Welcome to the Make community!

You can use a “Set variable” module with the built-in map function to pick out the keys you want:

{{ map(28.array; "id") }}

If you want to learn more about Make, you can read up in the Help Center. I also recommend doing the tutorials in the Make Academy, and learn advanced skills like how to make custom apps to any API in the Make Partner Training Portal - both have certificates for successful completion.

3 Likes

Hi @samliew,
thanks a lot for your help!

What would be the right key for “Record ID”

I dont’ see any “Record ID” in your screenshot. You need to mouseover the keys to see the “raw values” to use in the Map function.

Please provide the following:

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle 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 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

EDIT: I solved it by using Airtable–Get a Record between Iterator & Aggregator.

Sorry for the confusion @samliew .
I need to use map() for another Array aggregation output.
The key has the name “Record ID” here.

2 Likes

Hi @Faris_Ben_Saad welcome to the community :blob_wave:

I just want to quickly step in to say great work figuring this one out with the assistance of @samliew :clap:

It’s great to see that you managed to get this up and running and thanks a lot for sharing the extra info and your final setup. Your insights are 100% appreciated and will surely benefit many others in the future. :pray:

1 Like