I am trying to share information between two tables, a short list of info and a long list of info. There is a checkbox column in the long list that when checked, it adds that record to the short list. But if the record is unchecked, I want to delete that record from the short list, so it is not there anymore. I haven’t found an easy way to do this, so I wanted to throw it out here.
If It is only a check mark you can use a filter. But if you need to delete a record you would need to use a script or make.com
Would the script look something like this?
let inputConfig = input.config();
let recordId = inputConfig['recordId'];
await shortTable.deleteRecordAsync(recordId);
Yeah that script looks mostly right, you’re missing a declaration of ‘shortTable’ though
---
You’ll also need to set up ‘recordId’ as an input variable, see the ‘Input’s section from the docs:
https://support.airtable.com/docs/run-a-script-action#setting-up-a-run-a-script-automation-action
This also depends on how your tables are structured. Assuming that ‘recordId’ is taken from a linked field to shortTable, then you’ll need to use ‘deleteRecordsAsync’ instead, and so here’s a script you can try:
let shortTable = base.getTable(‘TABLE NAME HERE’)
let {recordId} = input.config();
await shortTable.deleteRecordsAsync(recordId);
Are you sure that you need to split your record info across 2 different tables?
If you only need to see certain information about a record (short info vs. long info), you can use 2 different views or 2 different interface pages for that.
- ScottWorld, Expert Airtable Consultant
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.