E9.2 How to loop a connector to perform Pagination on JSON response with possible_pages = n

jdecoder

Well Known Member
Hi,

I have a rest endpoint something like this :


which return JSON paylod something like this :

{
"data":[
{"person_id": "a739fc72-ccd4-46b9-b236-9b25ce1651bb", "person_name": "BEN", "employee_number": "1045469",…},
{"person_id": "bade3bb1-c1f1-4f01-b4ae-125d617c9cdd", "person_name": "BRANDY ", "employee_number": "1134894",…},
{"person_id": "89c6f809-6b3d-4f5d-aacc-b7eab5efca40", "person_name": "DANIEL ", "employee_number": "1147942",…},
{"person_id": "fa99f895-c203-4cc1-90d3-8f3db3b37340", "person_name": "MIKE ", "employee_number": "1021674",…},
{"person_id": "8aa8e6ef-2596-4e68-babf-ed9e63282a06", "person_name": "JIM", "employee_number": "1141923",…},
{"person_id": "a97d2828-2bb4-4490-9aba-43cefc52794b", "person_name": "RAJ ", "employee_number": "1131108",…},
{"person_id": "d7d2071b-4c40-4c16-a5c5-7186b09c0a1a", "person_name": "MONICA ", "employee_number": "1020632",…}
],
"possible_pages": 10,
"current_page": 0
}

Now I need to loop the connector in the orchestration to get the rest of the data.
What are the best practices to do this loop ?

1. do I save the possible_pages in a DB or can I save it in a variable
2. do we need a groovy + cURL combo and not use a connector ?
etc...

Please advice what you might do or has done in this situation.

Regards,
Suraj
Apps E920
Tools 9.2.4.4
 

guru1206

Member
Hi,
Refer document E1: ORCH: Example for Parsing JSON to Set Output Variables (Data Set Variable) Using Groovy(Doc ID 2667935.1). Though not related to your case 100 percent but you can extract the content what you are looking for.

Let us know how it goes.
 
Top