One Star

[resolved] tRest Talend with dynamic URL and paramters from DB

I'm trying to use Talend to get some data from a REST web service by a keyword. After this I will store this data on DB. At this point everything works fine, but just for a simple keyword that I used for test in the URL.
Now I want to use many keywords from DB. I am trying to link tPosgresqlInput componenet to the tRest component and to see how to pass DB rows value in the URL, but its seems that tREST does not accept things like this.
This is waht I did until this time :
tPosgresqlInput xxxxxx tREST ---> tExtractJSONFields ---> tMap ---> tPosgresqlOutput
I hope someone helps me to get out from this before the new year.
Thanks for describing each step because I am too beginner .
Smiley Happy)
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] tRest Talend with dynamic URL and paramters from DB

Hi
You need to use a tFlowToIterate component to iterate each row, so that you are able to access the input data extracted from DB and set a dynamic URL. For example:
tPosgresqlInput -main(row1)--tFlowToITerate--iterate-->tREST ---> tExtractJSONFields ---> tMap ---> tPosgresqlOutput
on tRest, you can set a dynamic url like:
"http://localhost:8088/otherpath/"+(String)globalMap.get("row1.columnName")


Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
1 REPLY
Community Manager

Re: [resolved] tRest Talend with dynamic URL and paramters from DB

Hi
You need to use a tFlowToIterate component to iterate each row, so that you are able to access the input data extracted from DB and set a dynamic URL. For example:
tPosgresqlInput -main(row1)--tFlowToITerate--iterate-->tREST ---> tExtractJSONFields ---> tMap ---> tPosgresqlOutput
on tRest, you can set a dynamic url like:
"http://localhost:8088/otherpath/"+(String)globalMap.get("row1.columnName")


Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business