Question

Deleting a record in Airtable

  • 11 October 2021
  • 3 replies
  • 1211 views

Userlevel 1

Use case: I use Airtable to contain episode data for my podcast. Once a record is added to the main tab “Episode Content,” the episode is automatically published to my website.

Question: I am running a zap beginning with "Schedule by Zapier" trigger to run every Monday at 6:05 am Mountain Time. The next step then goes to Airtable with a search action to find a record in a tab called "Upcoming" with a publish date that matches the date of the search. Then it goes to an Airtable create record action which then creates that same record within the same base in a tab called Episode Content.

The problem is that this is only copying the record over rather than actually moving it. So after the action runs, I now have the same record in both tabs. I would like to be able to remove the record from the original (Unpublished) tab but cannot figure out a way to do that. Is there a method that I am overlooking? Or is this a request that needs to be made to Airtable to update their Zap with that action option?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +14

Hi @awills 

You’d have to use the Airtable API: https://support.airtable.com/hc/en-us/articles/203313985-Public-REST-API

This can be done via Airtable Automations (Run Script action) or via a Zap step that uses the Webhooks app or Code app.

Airtable Automations: https://support.airtable.com/hc/en-us/articles/360050974153-Automations-overview

Webhooks: https://zapier.com/apps/webhook/integrations#triggers-and-actions

Code: https://zapier.com/apps/code/help

 

 

FYI: Feature requests and feedback can be made via Zapier Support: https://zapier.com/app/get-help

Userlevel 7
Badge +14

@awills

Here’s the JavaScript Code for using in a Run Script action of an Airtable Automation.

 

INPUTS

  1. Table
  2. RID

 

let config = input.config();
let Table = config.Table;
let RID = config.RID; // Record ID

// Delete a record in the Data table
let table = base.getTable(Table);
await table.deleteRecordAsync(RID);

 

Userlevel 7
Badge +14

@awills 

Here’s how to use it in a Zap with the Webhooks app.

NOTE: Make sure to add the Authorization header. (not shown)

NOTE: Make sure to replace these values in the URL.

  1. BASE_ID
  2. TABLE_ID
  3. RECORD_ID