Help

Re: Automation Script in Deleting a records when I will change the status to Delete

Solved
Jump to Solution
3237 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Ragie_Trigo
5 - Automation Enthusiast
5 - Automation Enthusiast

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!

1 Solution

Accepted Solutions
Ragie_Trigo
5 - Automation Enthusiast
5 - Automation Enthusiast

I got it! It works now life a charm! Thank you @kuovonne

See Solution in Thread

7 Replies 7

Welcome to the Airtable community!

This thread should help.

Ragie_Trigo
5 - Automation Enthusiast
5 - Automation Enthusiast

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.

Have you set up recordId as the input variable for the script?

Ragie_Trigo
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi, thank you for your response. How will I do that?

What I did is like this.
image

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.)

Ragie_Trigo
5 - Automation Enthusiast
5 - Automation Enthusiast

I think I’ve already done that. Can you please check if this correct?
image

Ragie_Trigo
5 - Automation Enthusiast
5 - Automation Enthusiast

I got it! It works now life a charm! Thank you @kuovonne