Search code examples
apietltalend

Talend use tRest returned value in another tRest


So i have a tRest component call that uses an api to get a unique ID for a report this first rest call is represented as follows enter image description here

i need to use the unique ID returned in another restful call to get back a json set of data

enter image description here

You can see i provided a static http var called id:135329...how can i reference what was returned by the first rest call?


Solution

  • you can take output from tExtractJsonFields component to tJavaRow and in that you store the returned id into globaMap.put("response_id",input_row.id); further in your next tRest call you can get this value by calling globalMap.get("response_id")

    tExtractJsonFields----->tJavaRow (globaMap.put("response_id",input_row.id);)
    |
    |
    |
    V
    tRest (globalMap.get("response_id"));