Create Airtable record with multiple attachments

Hello Bubblers,

I have been working on an app for a client who wants to also use Airtable as the database. Due to some limitations to the Airtable plugin, I am also working with the Bubble DB to achieve what they want to build.

One thing the client can on the app (on Bubble) is to create a new thing with several text fields and one ‘list of files’ field where I use the multi file uploader plugin so he can add multiple documents/attachments. My workflow works fine and the Airtable record gets created when I upload a single file (the attachment shows up in ‘attachment’ field in airtable) but it does not when I upload several files. When I do, the airtable is created but no attachments appear in my airtable field.

Am I missing something?
Thanks in advance for the help

5 Likes

same problem… next problem is deleting all attachments in Airtable record when I add attachment through plugin. @Bubble any help, please?

1 Like

Hello @pierre.tillement !
Did you do anything specific to make your single upload attachments show up in the attachment fields in Airtable ?
I am able to send text, numbers, dates from Bubble to Airtable but attachment fields remain blank.
Thanks a lot for your help :pray:

2 Likes

I love all the responses to this post from the people who know know whether or not this is possible, and/or if there’s a workaround. It really helps us less-knowledgeable folk.

each file uploaded to bubble has a URL. url is a text

if you first save the fileS first on bubble, I would try saving this list of texts instead of the list of files on airtable. have you tried that?

1 Like

Hi @TipLister ,

Sorry I just saw this. I hadn’t tried what you suggested, but I just did. AT doesn’t recognize the urls as files. Your suggestion made me wonder though what would happen if I first saved the AT file inside bubble, then tried to send both files to AT. That doesn’t work either. It seems that through the plugin we can only attach a single file, not truly “ADD” a file, and when doing so it will delete any existing files in AT.

The plugin is great until you get to this.

Thanks,

George

1 Like

So a file list in airtable/bubble is really a list of URLs.

For some reason, Bubble URLs are missing the “https:” when sent to Airtable – the URLs start with just “//.”

The solution I came up with:

  1. Save the list of URLs to a text field in Airtable.
  2. Use a formula field with REGEX_REPLACE to fix the missing "http:"s. You can copy the formula below and modify as needed:

REGEX_REPLACE({Temp Text Field}, “//s3”, “https://s3”)

  1. Set up a view in Airtable for anything that has text in that field.

  2. Run an Airtable automation based on that view. The automation copies the completed URL list from the formula field into my attachment field and then clears out the text field.

It’s a pretty roundabout solution (and uses up one of your Airtable automations), but it works.

5 Likes

If this didn’t work for you, try using single quotes on your regex replace formula.

2 Likes

@TipLister @gnelson @pierre.tillement @dschmid00 @cole2 @artisans
I was also applying this method and using your code (Thanks for that).

Unfortunately, today errors started occurring, because the images started to be passed by bubble in a different format.
They now just got passed with a // in the beginning instead of a //s3.

So the new code for the formula in Airtable needs to be:
REGEX_REPLACE({Image URL’s}, ‘//’, ‘https://s3’)

1 Like

Thanks for that.

Thanks so much @cole2 and @lennart.wittstock!

I’ve been able to save multiple attachments to Airtable using this workaround.

In my use case, there was a chance that the Photos field was already populated. In case other Bubble newbies like myself are struggling with the same problem, I’ll share my solution below.

Simply add a condition to the Automation described by @cole2 , checking whether the Photos field is already populated. If so, fill the field using the existing value (I choose to take the ‘Expiring Download URL’ value, not sure if it works with other settings) add a comma and then add the list you generated in ‘Photos List text temp formatted’.


All seems to work well, but I’d be glad if the Airtable plugin was fixed to actually ‘Add’ an attachment through the ‘Modify a record’ action, instead of replacing it.