Receive more than 100 records


#1

I have written a little vue.js app. I need it to access more than 100 records in my table though. How do I do that?

Here is my code.var app = new Vue({
el: ‘#app’,
data: {
items: []
},
mounted: function(){
this.loadItems();
},
methods: {
loadItems: function(){

                    // Init variables
                    var self = this
                    var app_id = "XXXXXXXXXXXXXXXX";
                    var app_key = "XXXXXXXXXXXXXXX";
                    this.items = []

axios.get(
https://api.airtable.com/v0/"+app_id+"/Donor Honor Roll?view=Grid%20view”,
{
headers: { Authorization: "Bearer "+app_key }
}
).then(function(response){
self.items = response.data.records
}).catch(function(error){
console.log(error)
})
}
}
})

Any help is appreciated.


#2

The Airtable API uses the concept of pagination.
It returns at most 100 records in one call.

The response will contain an offset if there are more than 100 records. Include this offset in the next request’s parameters


#3

If you use the js library provided by airtable (https://github.com/airtable/airtable.js ) it handles paging for you.


#4

Thanks, but I am not even sure where to start there. Not exactly a strong .js guy, but was able to follow a tutorial for vue.js to get info from my table. I see there is fetchNextPage(); but where would that go in my code now? I don’t want the user to have to click on anything to see the next record, I just want them all to be there.


#5

@Stefan_Welsh openside is right but Airtable has really poor documentation for this so look at this file: https://github.com/Airtable/airtable.js/blob/master/test/test_files/index.html