Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sherakama/68056e8b744649548c8d3778fdfe8280 to your computer and use it in GitHub Desktop.
Save sherakama/68056e8b744649548c8d3778fdfe8280 to your computer and use it in GitHub Desktop.
/** Delete a record based on finding record id in the 2way link field venue **/
const table = base.getTable("Web Only");
const inputConfig = input.config();
const recordId = inputConfig['recordId'];
const fieldName = 'Venue';
// Can't query just by a field value so we have to get all the fields and loop through them.
const queryResult = await table.selectRecordsAsync({fields: ['Name', fieldName]})
const matchingRecords = queryResult.records.filter((record) => {
const vals = record.getCellValue(fieldName);
if (vals && vals[0] && vals[0].id && vals[0].id == recordId) {
return true;
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment