Jan 12, 2022 01:26 AM
Hi, I’m trying to fetch all my table records that has a 500 columns inside but in this json result view it only fetch a random of 100 records in my existing table.
Here is my code. Thank you
//base1
const MY_API_KEY = “API_KEY”;
const AIRTABLE_BASE = “BASE_2”; //base 2
const results = await remoteFetchAsync(AIRTABLE_BASE+?api_key=${MY_API_KEY}
)
const data = await results.json()
// for(let view of data.fields){
// console.log(view);
// }
console.log(data);
Jan 12, 2022 08:05 AM
As is the case with every modern API, you need to make multiple calls to get all 500+ records. Look at the result set - you’ll see an attribute that can be used to make the next request for another 100 items.
Jan 12, 2022 08:23 AM
May i ask what is the attribute/code i need to add in order to get the remaining records? I’m stuck on this one. The const data has a multidimensional array which consist of
result > records > objects > the actual data i have to fetch
Jan 12, 2022 01:53 PM
It looks like you are using Scripting to access the REST API.
Are you trying to get records from a different base than the one where the script resides?
Jan 12, 2022 05:30 PM
Yes, i’m trying to get records from different base to compare data from 1 base to another.
Jan 12, 2022 09:09 PM
How can i fetch all the records from another base? I’m using the base 2 to update the columns from base 1. Is there any way for fetching all the records with or without the rest api?
Thank you :slightly_smiling_face:
Jan 13, 2022 04:06 AM
I would take a look at this -
Jan 13, 2022 04:41 AM
Read the REST API documentation about pagination and rate limits. You can get a maximum of 100 records at a time. If there are over 100 records available you will get pagination info in the results. Keep querying until you no longer get the pagination token. But also make sure you do not exceed the rate limit of 5 requests per second or you will be temporarily locked out.
Jan 13, 2022 04:59 AM
@Bill.French I will take a look and read this one.
Jan 13, 2022 05:00 AM
@kuovonne is the pagination you are talking about is the offset inside the array?