Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Feb 09, 2023 08:38 AM
Hi!
I'm trying to create an automation where, when a record is created in one table, a record is created in another. I want one field's data to populate from the first table into the primary field in the second. The automation to create the record is working great, but I'm having trouble populating the primary field. I've tried a variety of combinations of actions, and it works in preview, but when activated, does not work.
This is the automation in preview. You can see that the "Name" field is populated (primary field).
However, in once it's in place, the "Name" field (primary field) does not populate.
The current version of my automation has two actions:
* create record
* update record
Than
Solved! Go to Solution.
Feb 09, 2023 09:56 AM
Hey @Lauren_Briskin1!
So, you have an automation that is triggered on record creation, but when you create a record, there's not a guarantee that the original Name field even has a value yet.
The Airtable automation is triggered faster than the field can be properly filled in.
From a purely technical perspective, everything is behaving as expected.
However, this doesn't help you at all!
Here's some possible approaches you can take to get your desired result.
In your Social Dates and Deadlines table, change your primary field to be a formula field that returns the value of the linked record field if it has a value in it.
Something as simple as this would do:
IF(
{Election Name},
{Election Name},
"Missing Linked Election"
)
From here, your automation would simply need to link the records together. The formula will take care of the rest.
This is also preferable from a database implementation perspective, since it means that if you change the value of a linked record, you won't have to manually update the name of the record since it would reflect automatically.
If you're dead set on keeping the primary field an editable string, then the next alternative would be to change your automation trigger to fire on a record meeting a condition.
The conditions would probably be set to fire whenever a record in your All Elections table does not have the desired field blank and the record is not linked to a record in your Social Dates and Deadlines table.
Despite providing you a bit more control over when the record will be record to fire off the automation, you're still not going to have a 100% success rate on getting your desired result because it's possible that a user would begin typing in a value to the field but not complete their input fast enough before the automation trigger takes its "snapshot" of the target record for the automation run.
I wanted to tack on a small expansion on my first (and primary) recommendation to make your Social Dates and Deadlines table's primary field a formula field.
Since each record (presumably) correlates to a unique date and election combination, it would be semantically preferred if your primary field returned the date and the election name.
Take the following as an example:
Three elections share the same name. With your current design, you would have three records in your Social Dates and Deadlines table with duplicate values in their primary field, despite representing three unique dates.
Additionally, since you're copying the names of the original election record's to the date records, you have two tables that have records named the exact same thing. You'll want to avoid this.
Referencing your screenshot, the following record:
Miami Runoff Election (TBD)
Should become:
Miami Runoff Election (TBD)
11/21/2023
I don't have much more information to work with, but I'd be happy to talk more about the design part a bit more in-depth.
That being said, please let us know if you run into any issues or have any additional questions about the automation and overall configuration!
Feb 09, 2023 09:56 AM
Hey @Lauren_Briskin1!
So, you have an automation that is triggered on record creation, but when you create a record, there's not a guarantee that the original Name field even has a value yet.
The Airtable automation is triggered faster than the field can be properly filled in.
From a purely technical perspective, everything is behaving as expected.
However, this doesn't help you at all!
Here's some possible approaches you can take to get your desired result.
In your Social Dates and Deadlines table, change your primary field to be a formula field that returns the value of the linked record field if it has a value in it.
Something as simple as this would do:
IF(
{Election Name},
{Election Name},
"Missing Linked Election"
)
From here, your automation would simply need to link the records together. The formula will take care of the rest.
This is also preferable from a database implementation perspective, since it means that if you change the value of a linked record, you won't have to manually update the name of the record since it would reflect automatically.
If you're dead set on keeping the primary field an editable string, then the next alternative would be to change your automation trigger to fire on a record meeting a condition.
The conditions would probably be set to fire whenever a record in your All Elections table does not have the desired field blank and the record is not linked to a record in your Social Dates and Deadlines table.
Despite providing you a bit more control over when the record will be record to fire off the automation, you're still not going to have a 100% success rate on getting your desired result because it's possible that a user would begin typing in a value to the field but not complete their input fast enough before the automation trigger takes its "snapshot" of the target record for the automation run.
I wanted to tack on a small expansion on my first (and primary) recommendation to make your Social Dates and Deadlines table's primary field a formula field.
Since each record (presumably) correlates to a unique date and election combination, it would be semantically preferred if your primary field returned the date and the election name.
Take the following as an example:
Three elections share the same name. With your current design, you would have three records in your Social Dates and Deadlines table with duplicate values in their primary field, despite representing three unique dates.
Additionally, since you're copying the names of the original election record's to the date records, you have two tables that have records named the exact same thing. You'll want to avoid this.
Referencing your screenshot, the following record:
Miami Runoff Election (TBD)
Should become:
Miami Runoff Election (TBD)
11/21/2023
I don't have much more information to work with, but I'd be happy to talk more about the design part a bit more in-depth.
That being said, please let us know if you run into any issues or have any additional questions about the automation and overall configuration!
Feb 09, 2023 11:01 AM - edited Feb 09, 2023 11:02 AM
Thhanks so much @Ben_Young1 - this is really helpful and i'll play around with it. I think you got it just right re: database, structure, so I'll reevaluate. I wonder if there's a way to delay the automation like 3 seconds? 10 seconds?
ETA: I guess the "update" action that I have added is also happening too quick.
Feb 09, 2023 11:20 AM
If you would find it helpful, I don't mind tossing together a quick base as an example design and posting the base viewing link so you can duplicate the base and play around with it or ask any questions you might have about specific decisions.
Yeah, there isn't currently a way to delay an automation. I surfaced it with the Automations product team when they first released conditional action groups a long time ago, but I wouldn't expect to see that feature anytime soon. Nevertheless, if you adjust your database design, the automation as a whole is almost entirely irrelevant.
Feb 09, 2023 11:43 AM
okay the name formula worked great!