Created
March 1, 2024 20:54
-
-
Save sherakama/68056e8b744649548c8d3778fdfe8280 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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