Append to Attachment Field with Automation

Is it possible to use an automation to append to an attachment field without overwriting it? I asked a similar question about long text fields a while back but I’m not able to get it to work with attachments.

I have two attachment fields and I’d like to add the attachment from Field1 to Field2 without overwriting the attachments already in Field2. Later on in the automation, I’m clearing Field1 so that it can be populated at a later date (and this process repeated).

I think that you should be able to insert the new attachment URL, then type a comma, then put the old attachment URL after the comma. I know that this works with linked record fields… so I’m assuming it should work with attachments as well.

2 Likes

It appears that airtable is combining the urls and creating one new (broken) attachment file. It’s also using one of the original file IDs as the filename.
Screenshot of the input:


And here’s a screenshot of the automation result for the target field.

This feels like something going wrong on Airtable’s end, because it is not parsing the two incoming urls as two attachments. It just gloms them together and spits out a new url.

Side note: I’m trying to copy one attachment to another attachment field in the same record, rather than bringing in an attachment from some outside source. Could that be the problem?

Here’s the trick… it’s kind of unintuitive because Airtable doesn’t prompt you for it right away. You have to click on those little down arrows in the attachment field bubbles, choose to edit token, and choose just the URL for each attachment field.

I changed it both your way and editing the display value, and still no difference.
Screen Shot 2023-04-07 at 7.08.34 AM
As I understand it, attachment fields are an array. So what’s happening is the new url is getting appended to the old url, but not creating a new entry in the array?
I’ve opened a ticket with Airtable, but I’m not holding my breath on getting an answer.

@noahcoleman Strange that it’s not working for you, because it works just fine for me. Did you try putting the new attachment URL first and the original attachment URL second?

Although one key thing is that I’ve only tested with one attachment in each field, not multiple attachments in one field or the other. I will need to test later with multiple attachments.

If you can’t get it working with multiple attachments, I don’t know scripting, so I would personally do it using Make.

After some testing, it appears that the problem is with writing into a populated field. Airtable is able to populate an empty filed just fine, even with multiple attachments. I’ve come up with a workaround in my automation that uses a “buffer” attachment field and an extra Update Record step.

  1. Update Record 1
    • Fill the empty buffer field with the contents of Field1 and Field2, just as @ScottWorld suggested in his original reply.
    • Clear the contents of Field1 and Field2.
  2. Update Record 2
    • Fill Field2 with the contents of the buffer field.
    • Clear the contents of the buffer field. It is now ready for the next run of the automation.

It’s not the clunkiest workaround I’ve done, but it still bothers me that I can’t just put the two URLs into the existing field.

I’m glad you got it to work on your end, but it works just fine for me without any workarounds, and it works even if I have multiple attachments in both fields.

You may want to review your automation’s run log to see what the error message says for when it fails on your end. For example, if you’re trying to update an attachment field with a duplicate attachment, it won’t let you do that.

You can see the screenshot of my automation below. It always works under all circumstances.