Update Record step to append a record into a list of linked records rather than overwriting existing linked records

Hi,

I’m trying to use an automated Update Record step to add a new linked record into an existing list of linked records.

Unfortunately I’m finding that when the automation runs, it simply overwrites the field with the new record rather than adding the new record into the existing list.

Is there some way for the automated Update Record step to append a record into an existing collection of linked records?

Thanks very much.

Welcome to the community, @Anthony_Fennell!

I haven’t tested this myself yet, but I believe that you might be able to append an additional linked record by (1) inserting the original linked record field from the trigger record, (2) adding a comma, then (3) adding whatever is supposed to be appended.

Please try this and let me know if it works!

1 Like

It works! Brilliant, ScottWorld. I could kiss you!

Ha, that’s great! Glad I could help! :slight_smile: If you don’t mind, could you please mark my comment above as the solution to your question? This will help other people who have a similar question in the future. :slight_smile:

While it was my question, I wasn’t the one who posed it, so I think @Anthony_Fennell is the one who has to do that.

Hey, @Anthony_Fennell, welcome to the community, and thanks for asking that question!

1 Like

Oh, hahaha! Thanks for the clarification! :rofl::joy::sweat_smile:

Though I had to make some changes to get around the fact that Airtable saves a linked record as the record ID and not the string that is seen, and therefore the automation was failing.

At first I created a formula field that was simply a copy of the linked record field I wanted to add a record to - in my case {All Employers}. In the automation I did as you said, but the automation was failing I think b/c AT failed to match the comma to a record in the linked table (screen shot of error message below).

So I changed my formula field to include the field for the linked record I wanted to add - in my case {Temp Employers}. At first, I made the formula {All Employers}&’,’&{Temp Employers}, but the comma was giving AT automation problems in the cases where {All Employers} was empty. I also realized that the automation broke down if the linked record in {Temp Employers} already existed in {All Employers}. My formula ended up as

IF({All Employers},IF(FIND({Temp Employer},{All Employers})>0,{All Employers},{All Employers}&’,’&{Temp Employer}),{Temp Employer})

Below are screen shots of before and after, and below that the screen shot of the error message I was getting because of the comma, I think.


With Airtable’s automations, you can actually use names instead of record ID’s in your linked record field.

A linked field is an array, so you might be able to make your formula work by using one of Airtable’s Array functions.

For example:

ARRAYFLATTEN({Your Linked Field Name Here} & "," & "New Linked Record Name Here")

That will create a single array (instead of a nested array) of all your existing linked record names, plus whatever the name of your new linked record is going to be.

Hmmmm… I’ve played around a little bit with the various array functions, and tbh, i can’t make out the theoretical difference between join and flatten. i see they do different things, but quite often it’s not what i expect them to do.

it looks like your solution is similar to mine, in that we both create a formula field. i’ll see how your formula works compared to the one i came up with, which, btw, i’m about to edit, b/c i came across another hiccup, which is that the automation fails if the linked record that you want to add to the linked field is already linked to. Below is the formula I wrote to solve that issue:

IF({All Employers},IF(FIND({Temp Employer},{All Employers})>0,{All Employers},{All Employers}&’,’&{Temp Employer}),{Temp Employer})