[resolved] Dynamic REST URL with appended variable

Highlighted
One Star

[resolved] Dynamic REST URL with appended variable

My issue is with the URL path concerning the tREST component.
I want to be able to append a variable to the URL path which changes each time.
For example, I have a database with multiple rows and need to pass the id of the row as the last parameter in the url.
something along these lines: "http://localhost:8080/People-api/Person/"+ (Integer)globalMap.get(\"person_id\")
Is this possible?? Each record has a different person_id value so this URL needs to change with each call. Not sure how to resolve a value from a Java variable in the URL, nor if the escape character (\) would work properly there.

Thanks

Accepted Solutions
One Star

Re: [resolved] Dynamic REST URL with appended variable

I was able to make it work, simply by doing:
"http://localhost:8080/People-api/Person/"+ ((Integer)globalMap.get("person_id"))
Sometimes talend is very particular so its a lot of trial and error.

All Replies
One Star

Re: [resolved] Dynamic REST URL with appended variable

I was able to make it work, simply by doing:
"http://localhost:8080/People-api/Person/"+ ((Integer)globalMap.get("person_id"))
Sometimes talend is very particular so its a lot of trial and error.

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