Coda API - PageToken

Hello Coda Lovers! I’m currently kind of confused.

As many of you may have seen, i’ve been using something similar to the Coda Sync made by Al Chen.

Recently, i ran into a problem, where the API limitations for “List table rows” are smashing me, but i know how to solve it.
It’s limitation to 500 rows for each request can be worked around with Pagination, but i don’t understand how the page Token works. I’ll share a screenshot of my code so maybe someone can clarify how does it work.
Just to clarify: Before using the pageToken and modifying the code for it, it was working well.

Thanks for trying to help, anyone!

Hi @Pedro_Jimenez - Your use of the page token looks about right, what sort of error are you getting? In general the page token is like a bookmark, helping the API to remember when it left off. You get it in the response if there are more entries to fetch, and you pass it in the next request to resume from that point.

I was getting an error related to the pageToken, which is already solved!
For anyone having the same error as i am. What helped me to solve this error was giving an OR to the api call, because i found that when i was using it as null it was failing. I’ll paste what helped me solve it:

Hi @Pedro_Jimenez - Thanks for reporting back on the solution. I took a deeper look, and it turned out we were handling undefined correctly in the library but not null. I’ve released a new version of the Apps Script library (Version 11 in the dropdown) that fixes this bug, and your original code should now work as expected.