Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a delimited file of following format
Id, Location
x,y
This is used as input for a tRestClient-call where location is used as parameter
How can I achieve that in the response, I also can get the value of the id-column? Now I can only parse the xml-file but I cannot relate it to the correct id, which I need to be able to update the record.
You need to iterate the input so that you are able to access the value of id-column later, eg:
tFileInputDelimited--main--tFlowToIterate--iterate--tRestClient--tMap-->bababa
on tMap, add a new column called Id, set its value as below to get the current Id value.
(String)globalMap.get("row1.Id")
//for string type.
(Integer)globalMap.get("row1.Id")
//for int type.
Regards
Shong
You need to iterate the input so that you are able to access the value of id-column later, eg:
tFileInputDelimited--main--tFlowToIterate--iterate--tRestClient--tMap-->bababa
on tMap, add a new column called Id, set its value as below to get the current Id value.
(String)globalMap.get("row1.Id")
//for string type.
(Integer)globalMap.get("row1.Id")
//for int type.
Regards
Shong
But tFlowIterate cant interate to tRestClient
Hi,
Sorry to dig this topic up but I need to do the same as somersst who opened that topic.
I got a list of ids in my input file and I want to get a value from an API call response. My goal is to have the matching between my source id and the value the API provides me.
To do so, I did :
tFileInputDelimited - Main - tFlowToIterate - Iterate - tJavaFlex - Main - tRESTClient - tExtractJSON - tMap - tLogRow
In my tMap, I created a field and set its value like this : (String)globalMap.get("row12.fieldName")
As far as I can see in my tLogRow component, the field I created is empty but the data coming from my REST API call is correctly set.
Any idea ?
Thanks.
@Sébastien HEITZ , double check your expression
(String)globalMap.get("row12.fieldName")
here row12 is the row number before tFlowToIterate in your case, fieldName is the column name defined on tFileInputDelimited's schema.
Hi,
Thank you, my field name was correct I just replaced it when I posted but I was using the wrong row (the one after the tFlowToIterate component).