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: 
root
Creator II
Creator II

Create Context Variable as type "Document"

How can one create a context variable as type "document"? I am trying to save the tXMLMap output before sending it to tRestResponse
Thanks in advance for your help!

Labels (2)
3 Replies
Anonymous
Not applicable

I've not tried this, but I suspect you can create a context variable as type Object, save the XML Document to the Object context and when you want to use it, cast it from an Object to a Document.
So you could use a tJavaFlex to set the context variable. There is no need to cast to Object.
Main code
context.myObject = row1.document;
Then when you want to use the context variable as a Document, use it like below....
(Document)context.myObject
As I said, I've not tried this. But it should work.
Anonymous
Not applicable

On second thoughts, I think I may have misunderstood what you are asking. You should be able to just connect the tRestResponse to the output from the tXMLMap, create the expected schema (or use one you have in the repository) and that should do it.
root
Creator II
Creator II
Author

On second thoughts, I think I may have misunderstood what you are asking. You should be able to just connect the tRestResponse to the output from the tXMLMap, create the expected schema (or use one you have in the repository) and that should do it.

@rhall,
I need to manipulate the output (by encryption) before sending the response. The Json object is lost when doing any further manipulation. Hence, I was trying to save the output as a Document and then encrypt it before sending it via tRestResponse.
I have explained it in detail at: http://www.talendforge.org/forum/viewtopic.php?id=43734