Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

Run a script as an action in Automations cannot take recordId as an input

Topic Labels: Scripting extentions
Solved
Jump to Solution
640 3
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to update additional fields of an updated record accordingly.

Getting “undefined” value for recordId. What would be the problem?

let recordId = input.config().recordId;
console.log(recordId);

let rootTable = base.getTable('uretim-kaydi');
let rootQuery = await rootTable.selectRecordsAsync();
let record = rootQuery.getRecord(recordId);

Screen Shot 2021-06-11 at 21.07.25

1 Solution

Accepted Solutions
Ubeyd_Gungor
5 - Automation Enthusiast
5 - Automation Enthusiast

Sorry to bother, I didn’t see the left column of “input variables”. I created an input variable there and it’s ok now.

See Solution in Thread

3 Replies 3

Try

let {recordId} = input.config()

and make sure you’ve created an input config variable by the name recordId

It is a script as an action within an automation. I don’t see an option to create an input config variable.

Also, when I tried this, I get the error below:

let config = input.config();

let {recordId} = config.recordId;

console.log(recordId);

ERROR

TypeError: Cannot destructure property ‘recordId’ of ‘config.recordId’ as it is undefined.

at main on line 11

Ubeyd_Gungor
5 - Automation Enthusiast
5 - Automation Enthusiast

Sorry to bother, I didn’t see the left column of “input variables”. I created an input variable there and it’s ok now.