Help

Re: selectRecordsAsync() Strikethrough

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

I have a script that has been in production for months and just recently the script is failing on the selectRecordsAsync() function…

let config = input.config();

let tbl = base.getTable('Status');
let qry = await tbl.selectRecordsAsync();
for (let rs of qry.records.filter(id => id.getCellValue('Status ID') === config['Status ID'])) {
     <snip>
     break;
}

In the text editor the function selectRecordsAsync() the text is formatted as strikeout and I’m seeing this error message…

ERROR
TypeError: Cannot read property '0' of null
    at <anonymous> on line 4
    at main on line 4

Can anyone shed some light on what’s going on?

1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

The scripting API has been updated because Airtable wants to make the fields option a required parameter.

You can put in an array of the field values you actually need, or if you need a quick fix, you can use

await tbl.selectRecordsAsync({fields: tbl.fields});

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

The scripting API has been updated because Airtable wants to make the fields option a required parameter.

You can put in an array of the field values you actually need, or if you need a quick fix, you can use

await tbl.selectRecordsAsync({fields: tbl.fields});

Thank you for solving this mystery.