Updating Airtable with a new file (attachment field)

:bullseye: What is your goal?

I have a scenario that successfully adds multiple files to Airtable using Google Drive, an iterator, and an aggregator. This works perfectly, so if I have 10 files coming into my scenario, all 10 files end up in the attachment field in Airtable.
I want to be able to update the Airtable attachment field with one more file.

:thinking: What is the problem & what have you tried?

What I’m struggling with now is that I have those 10 files coming from one source, but I need to add one more file from a different source. I’m having difficulty figuring out how to correctly add this new URL to the array that will be used for the attachments.

:clipboard: Error messages or input/output bundles

I am unsure how to design the end of my scenario.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Hi @Pascal,

If I understand correctly, you already have 10 files coming from Google Drive through your iterator and aggregator, and they arrive as one complete array. Now you want to add one more file from a different source to that same group of attachments.

Solution
You can use the Make function called Add to Array. This allows you to take the array of ten files and append the extra file to it. Once combined, you can pass the updated array to the Airtable attachment field so all files are uploaded together.

Formula: {{add(array from aggregator; “new file link:)}}

If this helps, kindly mark it as a solution :+1:

That’s a solid question — you can merge the current attachment array with the new file by “spreading” the existing attachments into the array along with the new URL. Essentially, pass […existingFiles, { url: newFileUrl }] to the update module.

1 Like