User2014
User2014

Reputation: 101

How to pass context parameter to Query parameters value in Talend

In Talend studio, i am creating a job which involves supplying URL and query parameters to 'tRest_Client' component and facing below stated issue -

I am trying to pass context parameter data to Query parameter value as below

Context parameter -

Name : mis_id
Default : 10

Query Paramaters -

name : "query"
value : {target-rel[=context.mis_id]}

actual URL - URL+query={target-rel[=10]}

Here i am trying to pass value 10 with 'context.mis_id'

When i run the talend job, no data is passed to the Value of Query Parameter.

Please let me know if this is correct way to pass Context parameter data.

Upvotes: 0

Views: 2713

Answers (1)

Viki888
Viki888

Reputation: 2774

If you need to include the context variable in a query parameter, then try remember how Java works with a static string and a variable, since talend is a Java based tool.

Say in Java, I have a variable,

String world = "World!!!";
System.out.Println("Hello "+world); // This will display as Hello World!!!

Likewise, in talend you have to use as

"{target-rel[="+context.mis_id+"]}"

Hope this would help you out.

Upvotes: 0

Related Questions