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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Iterate tRestClient

Hi,

I spotted another similar topic, but the advice in there didn't seem to work.  I'm therefore posting my particular issue.

I am VERY new to Talend and have only being using it a few weeks, so please be patient 0683p000009MACn.png

 

I have first used a tRESTClient to retrieve a list of IDs from an API call.

I now need to feed those IDs, one by one into another tREST call to retrieve some additional information.

I am storing the response from the first tREST call in a tHashOuput, and adding an unique URL relative path as a column called url

e.g.

If I tLogRow the first tREST call subjob, this is how it looks

|---------+------------------------|
|entity_id|url                     |
|=--------+------------------------|
|1234     |/apiresource/users/1234 |
|1235     |/apiresource/users/1235 |
|---------+------------------------|

 

What I now need to do is iterate through these rows, one-by-one, making a tREST call.

So I link my tHashOutput to a tHashInput to get the data back.  I then do this:

 

tHashInput  >>row7>> tFlowToIterate >>Iterate>> >>OnComponentOk>> tRESTClient >>row(Response)>> tExtractJSONFields >>tMap>> tLogRow

 

At the end I'm getting TWO tLog rows, both showing TWO rows with null in both output columns

This is my tRESTClient

0683p000009M6jM.png

This is the final output of this job.  

Starting job UserMappingTest_2 at 17:04 23/07/2019.

[statistics] connecting to socket on port 3583
[statistics] connected
.--+-----------.
| tLogRow_2 |
|=-+----------=|
|id|entity_name|
|=-+----------=|
|null|null |
|null|null |
'--+-----------'

.--+-----------.
| tLogRow_2 |
|=-+----------=|
|id|entity_name|
|=-+----------=|
|null|null |
|null|null |
'--+-----------'

[statistics] disconnected

Job UserMappingTest_2 ended at 17:05 23/07/2019. [exit code=0]

 

What am I doing wrong?

Thanks

Steve

 

Labels (2)
10 Replies
lennelei
Creator III
Creator III

Happy to help you!