Help

Re: Scripting help - add related record to a field that already has related records

Solved
Jump to Solution
1810 0
cancel
Showing results for 
Search instead for 
Did you mean: 
cori_parrish1
6 - Interface Innovator
6 - Interface Innovator

i am using a step in an automation that i’m hoping will allow me to add a related record to a field that already has related records in it. the prior steps in the automation are picking out which record i want the script done to.

i am brand new to scripting, so i’m guessing it’s something obvious. i got this from the documentation here: Airtable Scripting

table.updateRecordAsync(record, {
‘Which trainings?’: [
…record.getCellValue(‘Which trainings?’),
{ id: newTraining }]
});

when i test the step, it says the field “Which trainings?” can’t accept the provided value & when i ask it to show me what it got from the step above, it shows me an empty set.

the newTraining value is the record id of the related record i want to add to the field.

any help is appreciated!!

11 Replies 11
cori_parrish1
6 - Interface Innovator
6 - Interface Innovator

thank you all! (and my apologies for the delay, i have a bunch of other responsibilities in addition to my fun Airtable updating, so i didn’t have time to get back and test it out before now.)

the update record instructions with putting the new training first worked!

i do want to be able to have the user choose which training they want to add to the list, rather than having to edit the automation each time. so that’s what i’m going to look into next. but it’s really great to know how to add a related record to a field with existing related records with an automation.

THANK YOU THANK YOU!

cori_parrish1
6 - Interface Innovator
6 - Interface Innovator

hello helpful helpers!

i'm doing another automation like this (changed the structure of my base slightly to help automations go more smoothly) and i'm running into an error that i don't know what to do with.

the automation looks at the registrations tab, and then finds the corresponding person in the attendance tab based on email address, and what i want to have happen is that it creates them in the attendance tab if they don't already exist, or adds the training to their list of trainings if they do already exist.

i made 2 conditional steps, the first one if the list of record IDs in the find step is not empty, then update that corresponding records. else if the list of record IDs in the find step is empty, create the person with the appropriate training they attended.

it's mostly working, but it's failing on a couple of random people who already exist. the error i'm getting is that the automation can't update a calculated field, which is not what i'm trying to do. i cannot tell why it's failing on only certain people. i've tried it where they already had that training in their list, and where they didn't (in case it was failing because the value was already there). any ideas?

thank you for any help you can provide!!