Attachment Field in Airtable - Array of objects expected in parameter

Hi Guys! I need your help with the following scenario:

  1. A list of products is returned from Shopify.
  2. I need to add a record in Airtable with one o more “Attachments”, depending on what is returned from Shopify. Here I get the following error: Array of objects expected in parameter in field “Adjunto” (Attachment).

This is the data returned from Shopify, this field can have one or more image urls.

This is how I have mapped it in Airtable:

Hi @avallese!

Airtable is expecting a collection including URLs and (optionally) FileNames. But the map function you’ve used is just sending a simple array or URLs.

For example, if you slide the “Map” control you’ll see Make is asking for something like this:

You can map the Src to the File URL field there.

This will, of course, only import the first image.

To create the correct array, you could Iterate over the Images array, and then use an Array Aggregator to build the correct collection to map to the Airtable app. If that sounded complex, i’ll walk you through it!

It will look like this:

The Iterator

The first Iterator will be mapped to your Images array. In my scenario the Images array is called “Logo”:

The Array Aggregator

Select your Iterator as the Source Module.
Your Target Structure Type will be your Adjunto field in the Airtable module.
Map the File URL from your Iterator module.

the Airtable Module

Map the Adjunto to the Array produced by the Array Aggregator module:

Like this:

Let us know how it goes.

Regards, Terry.

Hi Terry! Thanks for your reply.
I wanted to avoid adding more modules to my scenario.
Previously, I was using Google Sheets and this function worked fine to return all the urls separated by commas. Is there a workaround like this?

Hi @avallese ,

Sorry, not without extra modules. The map function you’ve used is just sending a simple array of URLs, but Airtable needs more info.

Regards, Terry.

Hi Terry,
Can it be converted to json or something like that?
[
{
“url”: “Images[1]Src”
},
{
“url”: “Images[2]Src”
}
]

I understand that I cannot insert this json directly in the “Adjunto” field.

I found a workaround.
As the json cannot be passed directly in the “Attachment” field because it is considered just a string. I used the Json Parse module.

I also used an If statement to create the json correctly. In my case, I only needed 3 images.

I am sure there’s an easier workaround. I got inspiration from this thread:

1 Like