Help

Automation question

Topic Labels: Automations
583 4
cancel
Showing results for 
Search instead for 
Did you mean: 
basbakker
4 - Data Explorer
4 - Data Explorer

Hello! How do i configure a automation in a way that when my action is triggered, the automation adds a user (people) to a already existing and specific cell? Please have a look at my screenshot, thank you so much!!!!

Greetz, Bas

4 Replies 4
Ben_Young1
10 - Mercury
10 - Mercury

Hey @basbakker
I've gone ahead and created a small demo to walk you through the behavior.

I have two tables: Projects and People. Pretty straightforward.

Ben_Young1_0-1674950466345.pngBen_Young1_1-1674950474048.png

Depending on what you're trying to do, you might want to approach this a few ways.
But here's a quick run through of how you can append new link records and avoid removing existing linked records.

Presume I'm working with the Project 1 record in the Projects table.
I'd like my automation action to append the Cameron James person record relationship to the Project Team field for Project 1.

Ben_Young1_2-1674950849758.png

I've set up my automation with a simple record update action.
However, once I have to define what the update to the Project Team field should be, I need to provide it either record IDs or record names that I want to be written to the field.
The problem is that I can't just type in only the record ID/name for the Cameron James record if I want to simply append the record to the entire list of linked records.
Here's a visual of what happens if I only specify the Cameron James record:

Ben_Young1_3-1674951196535.png

Ben_Young1_4-1674951302951.png

In order to avoid this behavior, we need to add the existing values of the linked record field to the update record action so that we declare that we want to use everything that was there beforehand, but also add one additional record. In this case, we want to just add the Cameron James record without unlinking the James Cameron and Julia James records.

To do this, you'll want to insert the previous values using the automation variables.

Ben_Young1_5-1674951703918.png

From our perspective, it may look a bit wonky because we see this:

"Project Team",recpKfWk4R4AGLfnq

 But from the automation's perspective, it looks something like this:

 ["rec4PC4uPvf9yed5K","rec8fq9jNPj7gqGAf","recpKfWk4R4AGLfnq"]

 Here's what the finished product looks like:

Ben_Young1_6-1674951990527.png

Ben_Young1_7-1674952069397.png

 

There's something really important to note about this method.
In my example, if there are no other linked records when the automation runs, it will fail and throw an error at you.
This occurs because of the comma we insert before the record ID. If the automation runs and there aren't any preexisting linked users to the project, then Airtable will read the automation input as:

[,"recpKfWk4R4AGLfnq"]

To get around this, we can utilize Conditional Action groups.
You'd create an action group that runs when the linked record field is empty, with the other action group running if there are preexisting values in the linked record field.

Here's a peek at the differences:

Ben_Young1_8-1674952979546.png

There are an almost infinite number of configurations that we can set up and walkthrough, so this may all change in form depending on your requirements or if I've misunderstood what you're actually trying to do.
Nevertheless, should you have any questions or clarifying information, feel free to toss them our way and we'd be happy to help dig in to it a bit more.

Hi @Ben_Young1 , Thank you so much for your comprehensive and good answer. I really appreciate. What I exactly need, is in short that everyone who signs up into my app (so the trigger is every time a new 'user' comes in the 'people' tab (so every time a new record comes in the 'people' tab because there is a new user who signs up)), this new user/person needs to be automatically added to an already existing and specific cell in the tab 'Projects' (without removing the other users/persons who are already added to this existing and specific cell in the tab 'Projects' . So what I think makes a different from your answer is that I don't yet have the recordID of the person/user/people who have to go to that specific cell. Because those people don't exist yet. I want to put every new created user/person in the 'People' tab to automatically be added to a specific cell in the tab 'Projects'. Can you help me with this? Thankyou so much!!

basbakker
4 - Data Explorer
4 - Data Explorer

Hi @Ben_Young1 , could you react on my last message?

All the fundamentals of the automation are the same.
You'd just set your trigger to fire when a new record is created in your People table.
From there, you can just use the record ID variable from the When a record is created trigger to facilitate the Update a record automation action.

Looking back at my previous example, let's say I have three project records.
When a new person record is created, I want to automatically link them to Project 1.

Ben_Young1_0-1675704263750.png

Ben_Young1_1-1675704289712.png

First, I need the record ID for the project I want to link new people to. The record ID for my Project 1 record is recDtCFV3fMNm5kia.

Now, I can just set up my trigger and single action.

Ben_Young1_3-1675704415570.png

Ben_Young1_4-1675704478753.png

That's all we need to do. Now, we can test it by creating a new person record. 

Ben_Young1_5-1675704528017.png

No worries about the data here. It's all sample data.
I've created this new person record to test the automation. As you can see, it has been automatically linked to the Project 1 record.