Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Automation triggering scripts - cannot get the actual record

Topic Labels: Automations
Solved
Jump to Solution
1150 1
cancel
Showing results for 
Search instead for 
Did you mean: 
TWu
6 - Interface Innovator
6 - Interface Innovator

Hi everyone, I’m trying to write my first automation and could use your help with some basics.

I need to use an automated script to modify multiple fields of the record and then I also need to take values to manipulate. The script below throws me the following error:

TypeError: Invalid arguments passed to recordQueryResult.getRecord(recordId):
• recordId should be a string, not undefined
    at main on line 4

I have an input variable defined:

name: ID
id: record (Step 1: Trigger) | Record ID

Then my script looks like this:

let table = base.getTable("Books");
let pitch = input.config;
let allrecords = await seriesTable.selectRecordsAsync();
let record = await allrecords.getRecord(pitch.ID);
await table.updateRecordAsync(record, { 'Status': 'Cancelled' });
let title = pitch.title;
1 Solution

Accepted Solutions
TWu
6 - Interface Innovator
6 - Interface Innovator

Oops, looks like I forgot the parentheses after input.config();

See Solution in Thread

1 Reply 1
TWu
6 - Interface Innovator
6 - Interface Innovator

Oops, looks like I forgot the parentheses after input.config();