Skip to main content
Solved

Automation triggering scripts - cannot get the actual record

  • December 20, 2020
  • 1 reply
  • 4 views

Forum|alt.badge.img+2
  • Inspiring
  • 17 replies

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;

Best answer by TWu

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

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+2
  • Author
  • Inspiring
  • 17 replies
  • Answer
  • December 20, 2020

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


Reply