Apr 23, 2021 04:02 AM
I am trying to run the following script:
const tableDeals = base.getTable("Deals")
const queryDeals = await tableDeals.selectRecordsAsync()
And I am getting an error “Your script exceeded the 512MB memory limit.”.
Though the Deals table has only about 3500 records and weighs about 4 MB. What am I doing wrong and how can I fix this? Thanks!
Jul 10, 2021 11:31 AM
Do you have any updates from Airtable about this @Sergey_Filimonov ?
Jul 10, 2021 12:12 PM
The selectRecordsAsync
method automatically collects all fields from all records. This a) takes more processing time for large tables, and b) could potentially eat a lot of memory with high record counts and lots of fields and data. It’s best to only collect the fields needed later in the script. This is done by passing an object to selectRecordsAsync
with a “fields” property that contains an array of field names.
const queryOrders = await base.getTable("Orders").selectRecordsAsync({
fields: [
"Field Name 1",
"Field Name 2"
]
})
Only those field names listed can be used later in the script for things like getCellValues
, etc.
Jan 31, 2022 01:37 PM
This worked like a charm. Thank you!
Jun 14, 2023 02:32 AM
Fantastic, thank you.