Skip to main content

Airtable API not returning more than 100 records


Ruchika_Abbi1
Forum|alt.badge.img+15

Trying to debug code written by someone else. It seems that the following code doesnt return more than 100 records even though fetchnextpage is set.
This seems to have stopped working recently and I'm not sure what has changed. 

return new Promise((resolve, reject) => { base(tableName).select({ maxRecords: 100, view: viewName }).eachPage(function page(records, fetchNextPage) { records.forEach(function(record) { data.push({ ----fields---- }); }); } fetchNextPage(); }, function done(err) { if (err) { console.error(err); return; } resolve(data); }); })

 

3 replies

dilipborad
Forum|alt.badge.img+20
  • Brainy
  • 215 replies
  • April 10, 2024

Hello @Ruchika_Abbi1 
Codes look the same as those given Airtable API instructions.

Just cross-check and check a couple of things to verify errors.
The first common thing is to check how many records are there.
Airtable has recently upgraded its API authentication from an Older use Key to a Token(AuthCode). Just cross-check you use Token with proper permissions.

If it's only paging related issue then see this section on your API reference What are the error codes you get?

👍


Ruchika_Abbi1
Forum|alt.badge.img+15
  • Author
  • Inspiring
  • 40 replies
  • April 10, 2024

Looks like I had to remove the following. 

maxRecords: 100

 


dilipborad
Forum|alt.badge.img+20
  • Brainy
  • 215 replies
  • April 10, 2024
Ruchika_Abbi1 wrote:

Looks like I had to remove the following. 

maxRecords: 100

 


I don't think that's maxRecords option matters when you've more than 100 records.
Try that. 🤞


Reply