Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jun 11, 2021 11:14 AM
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);
Solved! Go to Solution.
Jun 11, 2021 01:35 PM
Sorry to bother, I didn’t see the left column of “input variables”. I created an input variable there and it’s ok now.
Jun 11, 2021 01:01 PM
Try
let {recordId} = input.config()
and make sure you’ve created an input config variable by the name recordId
Jun 11, 2021 01:31 PM
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
Jun 11, 2021 01:35 PM
Sorry to bother, I didn’t see the left column of “input variables”. I created an input variable there and it’s ok now.