Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to loop the trestclient to reach the end of the api page

when i start with the url:"https://flow.pluralsight.com/v3/customer/core/repos/?offset=0"

it gives the data of 100 records like

{
     "count" :   1584 ,
     "previous" :   null ,
     "results" :   [
         {
             "id" :   1 ,
             "project_id" :   1 ,
             "added_by" :   {............... and so on
                                }
                       ]
         }
}
 
in this it also gives the next page value as next
untill next page value becomes null i want to loop my trestclient wit the next url
currently i am just incrementing my offset value in the url
like given in the image
0683p000009M9rl.png
Labels (3)
37 Replies
Anonymous
Not applicable
Author

i am adding an zip file i have removed the credentials

if is it possible can you give me the solution for the same question but 

extracting not only next data but also the results data from the out put 

actually my output should be some otherdata and the next value should used like pagination


AAflowData.zip
Anonymous
Not applicable
Author

I *think* I know what this is now. Very difficult to test this out without running it, but I think I have it.

 

You are testing for the value returned by "next" being null. It looks like it returns a String value of "null"....which isn't null. Try changing your IF condition to the following....

 

String rurl = row2.next;

if(rurl!=null&&rurl.compareToIgnoreCase("null")!=0){
       globalMap.put("myUrl", rurl);
}else{
       globalMap.put("myUrl", null);     
} 
Anonymous
Not applicable
Author

thank you its working fine now but its skipping the first value

because i have given the first value as the starting point so it displaying from the next value

 

Anonymous
Not applicable
Author

The first value you set (I assume you are talking about the first URL) will be the first one run. This shouldn't be causing the first value to skip. Maybe I have misunderstood?

Anonymous
Not applicable
Author

yeah the first value set is the first url

and its only printing from the next value

Anonymous
Not applicable
Author

What are you expecting to be printed that is not? Are you extracting anything other than the next URL at the moment?

Anonymous
Not applicable
Author

yeah iam trying to extract other values also like the results field from the output other than next value

Anonymous
Not applicable
Author

You will need to extract those values using the tExtractJSONFields component. If you are having issues doing that, there are several questions already answered regarding that on the Community. This thread is not really the place to continue this, unless you have further questions regarding API paging?