Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewdeveloper
Contributor
Contributor

How to iterate over RESTClient response and call Rest API for each interation

Hi everyone, I'm a beginner in Talend, so basically I need to call a REST API, extract one column of the response (array of ids), and then for each ID I need to call another REST API to extract more data. How can I do that?

I managed to get to the array of ids but I have no idea how to interact over each ID to call my next endpoint.

0695b00000LyTAKAA3.png

0695b00000LyTAdAAN.png

any help would be very appreciated.

Labels (4)
1 Solution

Accepted Solutions
gjeremy1617088143

Hi you can use tFlowtoIterate component after tExtractJsonFields with a main link then you use an iterate link on tRestClient and in the tRestCLient component you use the globalVar of the tFlowToIterate:

eg : if row2 is between tExtractJsonfield and tFlowToIterate then the variable will be (String)globalMap.get("row2.id").

Send me Love and Kudos

View solution in original post

6 Replies
gjeremy1617088143

Hi you can use tFlowtoIterate component after tExtractJsonFields with a main link then you use an iterate link on tRestClient and in the tRestCLient component you use the globalVar of the tFlowToIterate:

eg : if row2 is between tExtractJsonfield and tFlowToIterate then the variable will be (String)globalMap.get("row2.id").

Send me Love and Kudos

matthewdeveloper
Contributor
Contributor
Author

i cant create an iterate link between tFlowtoIterate and the next tRestClient

gjeremy1617088143

so you can iterate on a tJava empty and you put an on component ok link between tJava and tRestClient

matthewdeveloper
Contributor
Contributor
Author

i managed to create the iterate link by using normal tRest

 

0695b00000LyTL2AAN.pngis there any difference between tRestClient and tRest?

gjeremy1617088143

if you are familiar with tRestClient keep it :

tFlowToiTerate-->iterate link--> tJava (nothing inside)-->on component ok link--> tRestClient

matthewdeveloper
Contributor
Contributor
Author

thank you it worked