Skip to main content

Deleting related fields from another table

  • May 30, 2022
  • 3 replies
  • 28 views

I have 2 tables linked, one with job information (primary) and one with finance, when i delete one from the job information table the finance table still has its relevant data (information not linked to original).

Is there a way of automatically deleting the one when the other is deleted?

Thank you

3 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • 9814 replies
  • May 30, 2022

There’s no built-in way to do this. This can only be done with a custom JavaScript (which you could automate via Airtable’s Automations), or with an external automation tool like Make.com, or manually.


TheTimeSavingCo
Forum|alt.badge.img+31

Hey Aaron, as @ScottWorld said, you can run a script in an automation to delete a record once it’s no longer linked if you’re on a Pro plan. Here’s a working version of said script that you’ll need to customize:

let inputConfig = input.config()
let table = base.getTable('Table 2')

table.deleteRecordAsync(inputConfig.recordId)

If you’re not on a Pro plan, the best you could do is clear the fields I’m afraid:

I’ve set up both here for you to check out


  • Author
  • New Participant
  • 3 replies
  • May 31, 2022

Hey Aaron, as @ScottWorld said, you can run a script in an automation to delete a record once it’s no longer linked if you’re on a Pro plan. Here’s a working version of said script that you’ll need to customize:

let inputConfig = input.config()
let table = base.getTable('Table 2')

table.deleteRecordAsync(inputConfig.recordId)

If you’re not on a Pro plan, the best you could do is clear the fields I’m afraid:

I’ve set up both here for you to check out


Thank you for the clarification… Not going to lie… at this stage thats beyond my capabilities :joy: