Help

getRecord function lasts more than 3 seconds in db with 20k entries

Topic Labels: Automations
583 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Vladimir_Ermola
4 - Data Explorer
4 - Data Explorer

Screenshot 2021-04-19 at 22.11.16
Every time my script starts to find the specific record to work with it stops with an error.
My database has 20k entries with 30 fields.
There is no possibility to use scripting for managing records at all in such a case.

How can I solve that?

1 Reply 1

Welcome to the Airtable community!

Automation scripts are only allowed to use a maximum of 1 second execution time. If your script needs 3 seconds to run, you cannot use it in an automation.

One method of trying to improve execution time is to request only the fields in selectRecordsAsync. For example, if you only need the email field, you could try

let query = await table.selectRecordsAsync({fields: [email]})

How sure are you that getRecord or selectRecordsAsync are the culprits in you script? Is there more to your script than is shown in your screen capture? Are there any loops later on in the script?