Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to pass parameters to tRest component

Hi,
I have a job (see screenshot) whereby I am submitting a REST request with an http Body. I would like to make it more dynamic whereby I would pass a parameter value to the job e.g. right now you see the following:
<creationDate>2015-06-18T16:12:15.290-07:00</creationDate>
instead I would like to do something like
<creationDate>myDateParameter</creationDate>
where myDateParameter would come from a list of dates. How would I change this job to achieve that? Also, how do I specify parameter values?
Thanks,
Doug
0683p000009ME2q.jpg
Labels (3)
3 Replies
TRF
Champion II
Champion II

Hi,
I suppose you can have a tJavaFlex between the 2 tREST to change the body as you want or to set 1 or more global variables then, in the body you can use these variables:
- in tJavaFlex:
globalMap.put("creationDate", what_you_want);
- in tRest, field Body:
 "<overwriteFiles>true</overwriteFiles>
blablabla"+globalMap.get("creationDate")+"blablabla"
It should works.
Let me know.
Regards,
Fred
Anonymous
Not applicable
Author

Hi,
I suppose you can have a tJavaFlex between the 2 tREST to change the body as you want or to set 1 or more global variables then, in the body you can use these variables:
- in tJavaFlex:
globalMap.put("creationDate", what_you_want);
- in tRest, field Body:
 "<overwriteFiles>true</overwriteFiles>
blablabla"+globalMap.get("creationDate")+"blablabla"
It should works.
Let me know.
Regards,
Fred

0683p000009MDpA.jpg
TRF
Champion II
Champion II

Hi,
Put a tLogRow before tRest1 to see what is sent to this component.
Also, you can execute your job using the debug mode or put some traces in the service called by tRest1.
Fred