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

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)

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

All Replies
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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog