Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to iterate tRESTClient page number from Msql

hi,

 

I have an issue in my job,

I want to extract XML data using tRestClient, but i didn't understand how to iterate and change the page number at URL value in tRestClient

 

 

0683p000009LsOy.png

 

for example, i want to iterate tRESTClient(page=1) -- tExtractXMLField, and repeat that job from tRESTClient with page=2 until max page, and value max page i recieved from query in Mysql database

 

0683p000009LsWf.png

 

 

 

Best Regards,

Jackson

Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hey Jackson,

 

You can do something like this to iterate over the pages and construct the dynamic URL:
0683p000009LsHA.jpgIterate from the first to the last page0683p000009LsI7.jpgPut the current value to the globalMap0683p000009LsJe.jpgRead the actual value and construct the URL

Similar posts:

Also useful information from the GlobalMap: Talend globalMap Reference

 

Best,

Zoltán

 

View solution in original post

5 Replies
vapukov
Master II
Master II

You need manage URL - before tRESTClient

 

0683p000009LsSZ.png

 

when all prepared before - You are  have something similar to:

0683p000009LsOX.png

 

also depending from Your API request, You must mange - is it last page or not? as example:

0683p000009LsXE.png       0683p000009LsXJ.png

 

Anonymous
Not applicable
Author

Hey Jackson,

 

You can do something like this to iterate over the pages and construct the dynamic URL:
0683p000009LsHA.jpgIterate from the first to the last page0683p000009LsI7.jpgPut the current value to the globalMap0683p000009LsJe.jpgRead the actual value and construct the URL

Similar posts:

Also useful information from the GlobalMap: Talend globalMap Reference

 

Best,

Zoltán

 

Anonymous
Not applicable
Author


@devxr wrote:

Hey Jackson,

 

You can do something like this to iterate over the pages and construct the dynamic URL:
0683p000009LsHA.jpgIterate from the first to the last page0683p000009LsI7.jpgPut the current value to the globalMap0683p000009LsJe.jpgRead the actual value and construct the URL

Similar posts:

Also useful information from the GlobalMap: Talend globalMap Reference

 

Best,

Zoltán

 


 thanks is working,

but how to make Number of row for row generator value dynamically, ex for the last page value it defined from my Query result in Mysql


reply1.png
Anonymous
Not applicable
Author

I'm glad that it worked! 0683p000009MACn.png
To answer your question: There are a lot of possibilities, but if we don't want to use custom code with tJava, I'd use the tLoop component to iterate over the pages and call a sequence from the tRest component, see below:

0683p000009LsXx.jpgQuery for the last page0683p000009LsUB.jpgStore it in the Global Map0683p000009LsUS.jpgIterate until the last page0683p000009LsYC.jpgUse a sequence for constructing the page numbers and increment by 1

See more from the Numeric Routines: https://help.talend.com/reader/qsVMGPxPzq7IQ_Tij2uz2g/37l7UbXMZlUCZF0w8t4DQw

 

 

Regards,

Zoltán

Parikhharshal
Creator III
Creator III

@vapukov: Is there any way you can share code for this or share screenshot for each component what value you configured?

 

I have exactly same thing and I am getting stuck at various components with different errors.

 

Would really appreciate if you can share please.

 

Thanks

Harshal.