Help

Delete destination records after deleting in Airtable API

Topic Labels: API
1576 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Evgeny_Bylym
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi!

We sync Airtable records to our own bases via Airtable API.
The thing is when a record is deleted in Airtable it just vanishes from Airtable API.

To discover deleted records in API we have to iterate all records in both source and destination bases. Then delete records in destination with Airtable Ids that are missing in source.

Is there a way to track deleted records in Airtable to delete them in destination base without a one-by-one comparison?

Thank you.

2 Replies 2

You would need to delete your records in a different way than using Airtable’s built-in delete function. You would need to mark your records for deletion in some way.

For example, you could check a checkbox that indicates that you want to delete a record, or you could set a single-select field that says something like “Delete This Record”.

Then you could use the API to search for those records that you’ve marked, and then use the API to delete the appropriate records from both bases.

I’m not sure how you’re using the API, but you could use Airtable’s built-in automations to (1) run a script as soon as you mark the records for deletion, or (2) search your records on a schedule for marked records, and then run a script.

You can also use an external automation tool like my personal favorite Integromat to either:

  1. Immediately delete as soon as you mark a record.
  2. Search for your marked records on a recurring schedule.

These 2 options are the same options as Airtable’s automations, but no scripting required:

Scott, thank you for the direction. We’ll try this way.