how to make loop on pagination json request
Status: Closed · Asked by Khaled Alhaibi on · 0 views
example :
i have api I'm retrieving json data with 1000 record each put in each request i have to specify the page number and page size
NOTE :
The maximum page size is = 100
First page 1 -> page size = 100
second page 2 -> page size = 100
third page 3 -> page size = 100
i try to create counter for first page with schedule every 1 minute so i can loop for first 100 record but the issue that i face it how to move from first page to second page ?? i want when the counter reach 100 to change page number to second page 1,2,3,4,5

i want to loop on each object i have 100 object per page i know i can make via array but the issue is with get URL
https://api.zid.dev/app/v1/managers/store/abandoned-carts?page=1&page_size=1
this is the url should be dynamic in each new schedule minute
example :
1-
https://api.zid.dev/app/v1/managers/store/abandoned-carts?page=1&page_size=2
2-
https://api.zid.dev/app/v1/managers/store/abandoned-carts?page=1&page_size=3
3-
https://api.zid.dev/app/v1/managers/store/abandoned-carts?page=1&page_size=100
4-
https://api.zid.dev/app/v1/managers/store/abandoned-carts?page=2&page_size=1
We have created a sample workflow named "testing". We have mapped the counter for page increment as shown below -

Please test this workflow at your end and let us know how it goes.
yes i do this but what about page counter?
my issue is the counter page when page size =100 page counter should increment
i need feature like custom java script code or global variable in workflow so i can create to variables and add math operation each run i add 1 to the page size value the when page value reach 100 so i make the page value = 2 so i add after 100 i add 1 to page to move to second page and feach new 100 record

As of now, we do not have the option to use custom Javascript code.
We recommend using the Iterator step for your use case. Please go through the video tutorial of the Iterator to know how it works -
youtube.com/watch?v=zJaGQ-SIB0I
The Iterator will work in the following format -
Counter 1 -
- Get API list 100 rows.
- The iterator will insert all the rows one by one.
Counter 2 -
- Get API list 100 rows.
- The iterator will insert all the rows one by one and so on....
We have made a workflow named "Testing" in your Pabbly Connect account so that we can test and it will work exactly in the same as per your use case - https://connect.pabbly.com/workflow/mapping/Ijg2NTU2Ig_3D_3D
Kindly test the workflow at your end once and let us know how it goes.
brother i already test iterator before it will not work with my scenario
because im trying to send whatsapp message if i send one time 100 message i will get block via WhatsApp
so what i want to send only 1 to 4 message per minute only
the workflow you send me will not work as i want
i want to save the first 100 row in array by pabbly so i can loop on array to select index [0] send message then index [1] then index [2] after i reach index [100] then the page counter will increment

in the picture im saving the 100 row response in array so i can loop to 100 row via counter each new 1 minute in schedule i will move to the second index in array to avoid repeating sending of WhatsApp message in iterator it will repeat the message every new i minute
the only solution is to make {global page variable} so i can increment the global page variable when page size counter each 100
the issue im facing it now is im not able to change the page counter variable when the page size counter reach 100
my scenario is only to send broadcast message via whatsapp every 1 minute i want to send 1 message i want just to loop in all pages in api and each row in single page i almost found the solution via array but the only issue as i said i should have 2 counter first counter will increment each minute second counter will increment only when first counter reach 100
@khaled_Social I would I like to help you if you want, PM me here(no charges) - https://www.facebook.com/fagun.shah.7/
@khaled_Social I would I like to help you if you want, PM me here(no charges) - https://www.facebook.com/fagun.shah.7/
thanks bro i send you
thanks a lot Mr @Fagun Shah you help me to fix my issue I highly recommend Mr @Fagun Shah he have high experience and very fast response this guy should be with pabbly team because he have a lot of experience thanks a lot