I’ve API to get local business information like phone, website, address, etc worldwide.
then i want to implement our api to Zapier platform
My integration already on public beta, and i just have 1 trigger (for select option only) and 1 create action for searching data.
The flow I want to build is simple. 1) user search data then save data into spreadsheet
But, the problem is, my API is using cursor for pagination, and iam still confuse regarding how to perform create action (searching data) continuously with next cursor.
Help me please.
what the best method for trigger app if the flow like above
give me example about how to perform create action (searching data) with next cursor from response and continuously
Thank you
Best answer by Christian WBest answer by Christian W
Hi there!
I can see that you have written in to our Support channels in addition to this post, and as your request is pursuant to some specific details of your integration, I’ll reply to you there so that we can dig into the specifics together.
Generally speaking, pagination is supported only on triggers which serve to populate a dynamic dropdown menu with options (as you’ve correctly identified). This is because a within the context of a dynamic dropdown, the following process is possible:
A user will open the dropdown menu, causing the trigger to fetch the first page of data from your API
That data is transposed by your Zapier integration into options for the dropdown menu
The user can click the “See more” button to prompt Zapier to use your trigger to fetch the next page of data from the API
The specifics of implementing pagination will depend on the requirements of your API, which we can discuss further in your Support ticket. At the high level though, this works by:
Referring to the page number that Zapier tracks for you in `bundle.meta.page`. This will be incremented automatically each time the user clicks the “See more” button
After collecting the first page, set a cursor by calling `z.cursor.set()` and passing the appropriate value from your API response
When collecting subsequent pages, collect that cursor by calling `z.cursor.get()` and using the result in the API request (to ensure the data returned starts where the previous request left off)
I hope this helps to provide some high-level context, and I’ll be in touch with you shortly to discuss the specifics of your app via the Support ticket :)
I can see that you have written in to our Support channels in addition to this post, and as your request is pursuant to some specific details of your integration, I’ll reply to you there so that we can dig into the specifics together.
Generally speaking, pagination is supported only on triggers which serve to populate a dynamic dropdown menu with options (as you’ve correctly identified). This is because a within the context of a dynamic dropdown, the following process is possible:
A user will open the dropdown menu, causing the trigger to fetch the first page of data from your API
That data is transposed by your Zapier integration into options for the dropdown menu
The user can click the “See more” button to prompt Zapier to use your trigger to fetch the next page of data from the API
The specifics of implementing pagination will depend on the requirements of your API, which we can discuss further in your Support ticket. At the high level though, this works by:
Referring to the page number that Zapier tracks for you in `bundle.meta.page`. This will be incremented automatically each time the user clicks the “See more” button
After collecting the first page, set a cursor by calling `z.cursor.set()` and passing the appropriate value from your API response
When collecting subsequent pages, collect that cursor by calling `z.cursor.get()` and using the result in the API request (to ensure the data returned starts where the previous request left off)
I hope this helps to provide some high-level context, and I’ll be in touch with you shortly to discuss the specifics of your app via the Support ticket :)