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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

passing value to trest

hi ,

 

I have an issue in my job.

I have loaded some reports from an API using tRest component.

while I am extracting that API ,I am getting some data like id,name and key column and value below it.

so I have done the job like tRest component(POST method) --> tExtractJSONFields ----> finally loaded it to tfileoutputexcel

so in this I am getting ouput like

id,name,key

1,janu,Mnv674=

 

so the key which I got will be expired in every 8 hours.

so I want the key to be parsed to another trestcomponent (POST method) automatically.

I have done the job like

tREST component (POST method)  -->  tExtractJSONFields  ----> tfileoutputexcel --------------------- (on component ok) ------> tREST component -------> tExtractJSONFields ------------> tfileoutputjson

in the 2nd tREST component I will pass the key we are getting from the excel output into the http headers. 

 

I want the key to be automatically loaded to the second job.

 

could anyone of you please help in this.

 

regards,

harshi

 

 

 

 

Labels (5)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Injarapu,

 

I don't know if it's work, but you can try this.

After your tfileoutputexcel, you can use a tJavaFlex and in the principal code, write : globalMap.put("KEY", tFileoutputExcelRow.key)

Then  :   tJavaFlex --- Iterate --- tRest

And on your tRest, "http://www.blabla.com/"+(String)globalMap.get("KEY")

 

Good Luck ,

SGV

View solution in original post

16 Replies
Anonymous
Not applicable
Author

Hi Injarapu,

 

I don't know if it's work, but you can try this.

After your tfileoutputexcel, you can use a tJavaFlex and in the principal code, write : globalMap.put("KEY", tFileoutputExcelRow.key)

Then  :   tJavaFlex --- Iterate --- tRest

And on your tRest, "http://www.blabla.com/"+(String)globalMap.get("KEY")

 

Good Luck ,

SGV

Anonymous
Not applicable
Author

Hi
Store the key to context variables for used on the second calling. eg:'
tREST component (POST method) --> tExtractJSONFields ----> tfileoutputexcel -----main--tjavaRow---------------- (on component ok) ------> tREST component -------> tExtractJSONFields ------------> tfileoutputjson

on tjavarow:
context.key=input_row.key;

on the second tRest, you can use this context variable.

Regards
Shong

Anonymous
Not applicable
Author

thank you but its not working sir

Anonymous
Not applicable
Author

thank you sir its working
Anonymous
Not applicable
Author

You talk about which solution ? Can you send screen shot of your test please with settings ? I'm pretty sure that my solution works, or I don't understand the purpose of your job ...

Anonymous
Not applicable
Author

sir,

sorry the solution you gave is not working.

context.key=input_row.key;
after passing it into tJavaRow then talend is throwing error as
key cannot be resolved or is not a field.

could you please tell me any other way
Anonymous
Not applicable
Author

can anyone please help me in this
Anonymous
Not applicable
Author

Where are you blocking ?

I thought that your problem was solved.

Anonymous
Not applicable
Author

sir ,

I want the output coming from tJavaflex or tjavarow and sending it to trest http header value.

I am not able to pass the variable to another trest component.

please help me in this