Searching Airtable to either update or create record

Describe the problem/error/question

I am scraping TikTok feeds daily. I want to check my Airtable DB with the scraped songs and videos, if the scraped UID exists in my database then I will update it, if UID does NOT exist in my DB I want to create a new record for both the scraped video and the song.
I Have used the Airtable filter formula within the list module, but I could not access the list of videos that did not pass the filter for me to create a new entry for the videos and songs I did not have already.
Lastly, I could not get the automation to repeat for each of the 30-35 videos without the split in batches module, is this correct?

I had this working in make but I just can not put my finger on what I am doing wrong. Thank you!

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: Latest cloud
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: windows 11 pro

Hi @Zac_Magee

For your information, Airtable API makes it possible to “upsert”, that is to update or create if it does not exists

This option is not implemented in n8n Airtable node, so you’ll have to make direct API calls for example:

Maybe this can help

1 Like

Thank you for your reply!

Just wanted to add to this. You do not have to use an API call to use the upsert is is within the settings of the Airtable node.

I have never quite understood how an upsert works even in make. Am I correct in saying that this will search for me? Say I have 15 videos in the DB already and 15 that are not. This will check the parameter that I assign to be checked, then if that ID does not exist it will create a record in that database.

Is there no way to have both the items that exist and do not, pass through the node to deal with both datasets later on in the workflow?

I have updated to use the “Upsert” and all this does it create a duplicate record. No matter the matching field that I use.

In Make.com the workflow works as shown below.

So after many tries I was able to get this to work

Solution.
I used the “Upsert” option and used the UNIX timestamp as a reference to check if the record existed. I am yet to find a way to use the Airtable ID as a reference yet but as of now this works.

1 Like

Cool

Why did’t you use the Unique ID you tried to use in your listing previously ?

digi-studio 2023-09-08 at 09.23.30

By the way, upserting is really more efficient as it lets you update/insert 10 recors in 1 call.

In a world where Airtable API calls now have an hard limit on “team plan” this is valuable :slight_smile:

1 Like

I was unable to get it to run smoothly while using the ID. I have since utilized the set node in a few places to cut down on the data sent throughout the workflow and the Unix timestamp seems to be the best way for me to match.

I agree, even in Make.com that was the reason I moved to N8N. The costs ran up so fast performing so many actions that could be done together.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.