May 05, 2022 04:19 AM
Hi there,
How can I create automation script to delete a record when I’m changing the status to Delete.
I hope someone can help me. Thank you!
@kuovonne help!
Solved! Go to Solution.
May 13, 2022 11:07 AM
May 05, 2022 05:07 AM
Welcome to the Airtable community!
This thread should help.
May 13, 2022 04:14 AM
HI @kuovonne It doesn’t work on my end.
I tried this script
let table = base.getTable(“BILLING”);
let inputConfig = input.config();
let recordId = inputConfig[‘recordId’]
await table.deleteRecordAsync(recordId);
But it has an error with this
ERROR
TypeError: Invalid arguments passed to table.deleteRecordAsync(recordOrRecordId):
• recordOrRecordId →
recordOrRecordId should be a Record, not undefined
or recordOrRecordId should be a string, not undefined
at main on line 4
hope you can help me with this.
I want all statuses with “DELETE” will be deleted on the BILLING table.
May 13, 2022 04:29 AM
Have you set up recordId
as the input variable for the script?
May 13, 2022 04:41 AM
Hi, thank you for your response. How will I do that?
What I did is like this.
May 13, 2022 04:53 AM
The status of delete needs to go in the automation trigger, not the input variable for the script.
You need to create an input variable named recordId
and select the value of the record id of the triggering record. (Use the blue plus sign to select the value.)
May 13, 2022 05:13 AM
I think I’ve already done that. Can you please check if this correct?
May 13, 2022 11:07 AM