Hi all!
Time for me to again turn to the KNIME collective mind with a JSON question. I want to send a table to data to an API and it takes a JSON input with an array. I cannot figure out how to in KNIME easily create JSON Arrays.
For example, I have a two column table, id and text, I want to turn the table to a JSON output but the API is expecting all of this data to be wrapped up into an array named documents.
Here’s the output I require;
{
“documents”:[
{
“id”:“1”,
“text”:“Hello world”
},
{
“id”:“2”,
“text”:“Bonjour tout le monde”
},
{
“id”:“3”,
“text”:“The food was cold when it arrived it was disgusting”
}
]
}
I can’t figure out the array part. Thank you as always!