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: 
_AnonymousUser
Specialist III
Specialist III

tWriteJSONField => List of elements without key, kinda like array

Hi all,
I'm quite new to Talend and JSON at all. Sorry for bad technical description.
I have to create JSON Request for the tRestClient component with the following (simplified) format:

{
"identifier" : "DB_NAME",
"data" : {
"database_instances" : { "ROLP11", "ROLP12" }
  }
}


I have no idea, how to achieve the construct of "database_instances" (or what it even is in JSON terms). Is there a possibility to create this output with a JSON tree in tWriteJSONField ?
Thanks for your help,
Andreas

Labels (3)
1 Reply
Anonymous
Not applicable

Hello 
It is able to create the Json string as below by defining database_instances as loop element on tWriteJsonField.
{ "identifier" : "DB_NAME", "data" : { "database_instances" : ["ROLP11", "ROLP12" ]   } }

Then, replace "[" by "{", "]" by "}" after tWriteJsonField on a tJavaRow, before passing it to tRestClient.

Regards
Shong