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

its not showing any output i think it has gone into infinite loop

and my tjava_1 has no code and how to refer globalMap to the trestclient_2 to the tjava_2 component

 

0683p000009M9jC.jpg

 

output is struck in the same one since 10min

0683p000009M9au.jpg

Anonymous
Not applicable
Author

Your tLoop needs to be linked to the next component using the "iterate" link. 

Anonymous
Not applicable
Author

Sorry, I didn't spot the tLoop OnSubJobOK link in your screenshot previously

Anonymous
Not applicable
Author

Thanks a lot the final solution is going into infinite loop so please help it  

0683p000009M9jl.jpg

 

Anonymous
Not applicable
Author

You will have to test the value that is being returned by the "next" element. You are setting this in the tJavaFlex, right? What code do you have for this? Also, can you show the logic of the tLoop?

Anonymous
Not applicable
Author

tloop component

 

0683p000009M8sd.jpg

tjavaflex component

 

0683p000009M9ZS.jpg

Anonymous
Not applicable
Author

I'm afraid the end of your if condition is not visible in the screenshot

Anonymous
Not applicable
Author

code in the tjavaflex component is written in the main code part

 

String rurl = row2.next;

if(rurl!=null){
       globalMap.put("myUrl", rurl);
}else{
       globalMap.put("myUrl", null);     
}    

 

Anonymous
Not applicable
Author

sorry for the inconvience

 

0683p000009M9kU.jpg

Anonymous
Not applicable
Author

Can you export your job and post it on here please? I think I need to look at the actual job. It looks like it should be working. If you have any passwords or usernames anywhere in the job, please remove them or set them to empty Strings. Oh and what version of Talend are you using?