Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
iztoogood
Contributor III
Contributor III

Multiple tRestClient, then tMap and lookup

Hi,

i'm trying to make a job that starts with a first tRESTClient1 that return a list of IDs...

with those IDs, i have to call 2 other REST services... 

then i'm trying to merge the restult of those 2 other tRESTClients with a tMap ... without calling the first one 2 times.

i've tried to split the first rest result with a tMap or a tReplicate but it's prevent me to lookup...

how can i do ?

0683p000009M0lj.png

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

I think I understand what you need. If my understanding is correct all you need to do is this....

1) Connect your main tRestClient to the tMap first (making it your main row).

2) Connect the other two tRestClients afterwards (as lookup rows).

3) Open your tMap and set the "Lookup Model" for both your lookups to be "Reload at each row". This will reveal a section to create a set a globalMap variable. You can link your input data here and set a value from your main row. This globalMap is set for every row sent in and can be used by the lookup sources which will fire after the globalMap has been set.

 

Take a look here: https://help.talend.com/reader/wDRBNUuxk629sNcI0dNYaA/mxzKD~8eLuNFSXH6LMi7qg

View solution in original post

8 Replies
fdenis
Creator III
Creator III

use tflowToIterate .
tRESTClient1 -- tflowToIterate --iterate-- tRESTClient_2 (using globalMap value who have been set into tFolwToIterate).
you may want to add an tIterateToFlow before printing.
Anonymous
Not applicable

I think I understand what you need. If my understanding is correct all you need to do is this....

1) Connect your main tRestClient to the tMap first (making it your main row).

2) Connect the other two tRestClients afterwards (as lookup rows).

3) Open your tMap and set the "Lookup Model" for both your lookups to be "Reload at each row". This will reveal a section to create a set a globalMap variable. You can link your input data here and set a value from your main row. This globalMap is set for every row sent in and can be used by the lookup sources which will fire after the globalMap has been set.

 

Take a look here: https://help.talend.com/reader/wDRBNUuxk629sNcI0dNYaA/mxzKD~8eLuNFSXH6LMi7qg

iztoogood
Contributor III
Contributor III
Author

thank's a lot for your help...

i'll try to find examples and doc arround tflowToIterate ...

because just done like monkey... i have a "interdiction to plug flag" when tring to link to TRestClient 1 or 2...

iztoogood
Contributor III
Contributor III
Author

Thanks rhall_2_0 for your help,

i'm not sure to have well understoud your explainations...

the thing to have in mind is that ...

the 2 next restCLient depend on the result of the first.... i need to first run the first restClient, that return a list of id, that allow me next to build urls for the 2 other rest resquests...

so i don't think  plugin all 3 rest Client in a single tmap will allow me to have the result waited....

 

i will pratice a little bit arround flow to iterate to flow etc as suggest by fdenis ...

Anonymous
Not applicable

Your list of values will come back in a single response from your source tRestClient. So you will need to split these up into multiple rows. You will need to give an example of how these values are returned in order to help you split them up (are they JSON or XML basically).

 

But once you have split the values up, you can indeed do what I was suggesting. The "Reload at each row" will allow you to build your URL where the globalMap value is set and you can use that globalMap value as your URL. "Reload at each row" ,means the tRestClient components will fire for every input row of your Main source.

iztoogood
Contributor III
Contributor III
Author

Hi,

Thanks a lot rhall_2_0 ! you were right !

i manage to do what i needed !!

i just now have to totally rebuild my job... because my previous version is absolutly not reusable 😞

thanks a lot

see you to my next problem 😉

 
iztoogood
Contributor III
Contributor III
Author

as illustration for others (and for me later)

look like a spaghetti dish

0683p000009M0gk.png

 

Anonymous
Not applicable

Nice work!