Map array with specified keys

I want to add mapped image urls for my Airtable column.

In my array, I’ve got an Array from my shop with Images[‘full_url’]. When I try {{map(25.images; “full_url”)}}, it works like expected, but creates only numeric indexed arrays. For airtable they are needed in this format:
[{ url: ‘https://example.com/image1.jpg’ }], [{ url: ‘https://example.com/image2.jpg’ }], [{ url: ‘https://example.com/image3.jpg’ }]

How can I do this?

Hi @visioncode and welcome to the Make forum!

I cannot open any of your images. Could you embed them in your post please?
You can drag and drop them, copy/paste them or click the Upload icon at the top.

Thanks!

2 Likes

it’s not about the images there. They are just examples for my urls.

2 Likes

Hi @visioncode ,

I think that @Lauren_Moineau meant to upload the bundle containing your data, currently it is difficult to deal with your problem, because we cannot clearly see the structure of the data.

Thanks.

BR,

PBI

3 Likes

Hi @Philippe_Billet Thank you. Actually, I read too fast and was indeed asking for the pictures. But you’re right, the bundle is definitely the way to go here :slight_smile:

2 Likes

ok, sorry - I try to explain it with some code … :slight_smile:

This is an example of the output bundle of my first module (Etsy):

[
    {
        "listing_id": 1541561904,
        "images": [
            {
                "listing_id": 1541561904,
                "listing_image_id": 5294937634,
                "hex_code": "D3AE7E",
                "red": 211,
                "green": 174,
                "blue": 126,
                "hue": 33,
                "saturation": 41,
                "brightness": 83,
                "is_black_and_white": false,
                "creation_tsz": 1694810774,
                "created_timestamp": 1694810774,
                "rank": 1,
                "url_fullxfull": "https://example.com/example1.jpg",
                "full_height": 1772,
                "full_width": 1772,
                "alt_text": null
            },
            {
                "listing_id": 1541561904,
                "listing_image_id": 5362187571,
                "hex_code": "D3BD9E",
                "red": 211,
                "green": 189,
                "blue": 158,
                "hue": 35,
                "saturation": 26,
                "brightness": 83,
                "is_black_and_white": false,
                "creation_tsz": 1693403610,
                "created_timestamp": 1693403610,
                "rank": 2,
                "url_fullxfull": "https://example.com/example2.jpg",
                "full_height": 2048,
                "full_width": 2048,
                "alt_text": null
            }
        ],
        "__IMTLENGTH__": 1,
        "__IMTINDEX__": 1
    }
]

I want to save all images url_fullxfull URLs in an attachment field within Airtable.

The required mapping format for the airtable module attachment field is:

[
    {
        "url": "https:\/\/example.com\/example1.jpg"
    },
    {
        "url": "https:\/\/example.com\/example2.jpg"
    }
]

How can I transfer the first Images array to get to this format?

1 Like