I have a script set up to delete records when they enter a view.
I fiound the script on this forum, it's:
let table = base.getTable("Field & Nursery");
let inputConfig = input.config();
let recordId = inputConfig['recordId']
await table.deleteRecordAsync(recordId);
However, when this script runs, it triggers another automation. Update (I misspoke about how the automation works - amended here) The deletion is handled by:
- If the record appears to need deleting, the status changes to a pending deletion status
- A formula looks for records of the pending deletion status that are over x days old (depends on the kind of record) and outputs a "Delete" string (otherwise this field outputs nothing).
-The automation looks for records that match "Delete" in the formula field.
The script seems to behave in a way that the fields that are being watched "look" updated.
However, because the script is deleting the record, this second automation fails.
I assume there is something I don't understand about this script? Does anyone have any guidance?