Skip to main content
Best answer

Retain and add to existing attachments in field when updating Airtable record

  • 12 December 2023
  • 7 replies
  • 146 views

I have a roster of people who sign multiple contracts with us throughout the year, and was hoping to keep PDFs of those contracts organized within an attachment field in Airtable. My Zap currently works brilliantly except that when it finds the correct record, it updates it by deleting the old contract PDF and replacing it with the new contract PDFI want it to leave the existing PDF when it attaches this new one.

I’ve tried preceding the PDF element with a comma in the Action step (a desperate stab in the dark), which obviously didn’t work.

Additional flow/logic details, if it’s helpful:
1. Contracts are sent via HelloSign and once signed by all parties, land as PDFs in a Google folder.
2. New file in folder triggers the Zap.
3. Zap splits the text of the file title and returns the first portion (which is the person’s name).
4. Using this return, Zap finds the corresponding record in Airtable (which is already there; it does not create a new record if one isn’t found).
5. Zap updates one field only — the Contracts field — by uploading the PDF.

Any ideas? Also if you have thoughts for a tricky, convoluted workaround — even if it involves some kind of Airtable formula/rollup wizardry — I would love to hear them! Thank you in advance!

7 replies

Userlevel 7
Badge +14

Hi @rjs3461 

Good question.

You will need to map the new file followed by a comma followed by the existing files.

That way the new file is appended to the Attachment field.

Userlevel 1

Thank you! I’ve edited the Zap to include the file already attached in the found record. In this example, only one other file existed and the test worked, but when it ran again to append a third contract, it returned two copies of the first contract instead, and no new PDF, which I also don’t understand but maybe more importantly:

Is there a way to account for the possible existence of multiple preexisting PDFs in a case like this?

Userlevel 7
Badge +14

@rjs3461 

Flip the mapped variables, because there may be 0 existing files.

You will need to map the new file followed by a comma followed by the existing files.

 

When testing, make sure to retest each step in order.

Userlevel 1

I had the variables in this order because otherwise it didn’t retain the existing file at all. I tried again and retested each step with the same result: it removes the existing file and replaces it with the new one.

The problem is less that there might be 0 existing files and more that there will for sure be at least 1 and likely (ideally) more, but there’s no consistent truth about the exact number there could be, only that it’s >1.

Userlevel 7
Badge +14

@rjs3461 

Try using the File ID from the Airtable step configured like this.

 

Userlevel 1

Thank you  !!!  That was my error — using the wrong data field from the Airtable step 🙃. You have been so helpful (and patient!) and I’m so grateful!

Userlevel 7
Badge +6

That is awesome @rjs3461! Big thanks to Troy for pointing you in the right direction!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 😊

Reply