How do I check if a value is already exists in Airtable and if not create a new record

Hi, likely a very simple fix.

  1. Scenario gets ~20 RSS feed URLs and adds them to an Airtable.
  2. To ensure it doesn’t add a previously added URL it checks the URL field to see if URL already exists.
  3. It then uses Router to, if no, create record, if yes, do nothing.

I can not get this to work. It either begins creating multiple new records because it loops over a list of URLs with a unique URL individually, or it creates no records.

I can not have it create only unique records.

It is clearly about setting the search, formula, router logic, and router filters correctly, but I can’t find the correct set-up.

Any help would be massively appreciated.

Thanks.

Welcome to the Make community!

That’s what the error directive Resume allows you to do. First, you use a Search module to see if it exists, then Create a new item if it doesn’t exist. In the Create field, you use an if-statement to “ignore” a required field if there are search results, throwing an error and allowing you to “skip” the creation module.

The if (not-exist-create-ignore) throws the error (ignore if exists), which the Resume directive can be used to return the item from the Search module (to check if it exists).

Screenshot_2023-12-30_141250

I explained this in a similar older post but for Google Drive Can I skip a module based on a filter? - #3 by samliew

Hopefully you can adapt this to Airtable as well, seeing you are using a search module too!

2 Likes

Hi @samliew,

Thanks so much for the insight - really helped!

I ended up realising that I needed to add a TEXT AGGREGATOR after the AIRTABLE SEARCH, to pull all the search results into a single bundle which could be compared to the current value… otherwise it was looping through each search result, and adding a new record with each loop until it hit a matching record.

Hope this helps somebody in the future, and again, @samliew, thanks so much for your assistance.

2 Likes

No problem, glad I could help!

2 Likes

Hey there @TLB :blob_wave:

just wanted to step in and congratulate you for solving this issue with some assistance from @samliew. It is so inspiring to see Makers cooperating and figuring out solutions together!

Also thank you very much for stopping by with the additional details. We greatly appreciate that you are keeping our community healthy and neat. :broom:

Keep up the amazing work! :party_blob:

1 Like