Help

Update record if exists otherwise create a new one

Topic Labels: API
Solved
Jump to Solution
3686 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Gustavo_VD
6 - Interface Innovator
6 - Interface Innovator

I’m using the API to update an Airtable table on a daily basis. Everyday I’d get around 100 records to be updates or created on the table.

What’s the best way to tell Airtable to either update the record if a specific field matches a record which already exists otherwise create a new one?

Do I need to perform a search for each one of the records manually or is there a better way to do that?

Thanks!

1 Solution

Accepted Solutions
andywingrave
10 - Mercury
10 - Mercury

Hey there! Best way to do this is by searching for the value in the field, and creating logic that says “if this exists” update else create.

You wouldn’t need to loop through every value, you would just create a view based on the value you were searching for.

For example:

You would use filterByFormula in the request to look for records that matched your specific criteria

Hope that makes sense.

See Solution in Thread

2 Replies 2
andywingrave
10 - Mercury
10 - Mercury

Hey there! Best way to do this is by searching for the value in the field, and creating logic that says “if this exists” update else create.

You wouldn’t need to loop through every value, you would just create a view based on the value you were searching for.

For example:

You would use filterByFormula in the request to look for records that matched your specific criteria

Hope that makes sense.

Thanks!

That’s what I had in mind. I was wondering if there was a More automatic way to accomplish that without having to search (filterByFormula) for every record (not value) I’m about to add. Something like Typecast but for adding/updating records.

Thank you!