on 2017 Sep 20 6:03 AM
Hi Experts,
While trying to transform JSON document to XML format, receiving following error in HCI flow:
"cannot transform JSON document to XML: JSON document contains either more than one member in the root object or an array with more than one value in the root object. Only one member in the root object with no array or array with one value is supported"
It seems that this is due to limitation of JSON to XML conversion in HCI.
Tried to add Groovy script as per this Question but no luck with solution.
Input data sample is as below:
{"kind":"analytics#Data","id":"https://www.....com/v3/data? ids=xxx∈put1=value1,value2,value3,value4,value5,value6∈put2=Value7☆t-date=2daysAgo&end-date=1daysAgo&max-results=10","query":{"start-date":"2daysAgo","end-date":"1daysAgo","ids":"xxx","input1":"value1,value2,value3,value4,value5,value6","input2":["Value7"],"start-index":1,"max-results":10},"itemsPerPage":10,"totalResults":8568,"selfLink":"https://www......com/v3/data?ids=xxx∈put1=value1,value2,value3,value4,value5,value6∈put2=Value7☆t-date=2daysAgo&end-date=1daysAgo&max-results=10","nextLink":"https://www.......com/v3/data?input1=value1,value2,value3,value4,value5,value6∈put2=Value7☆t-date=2daysAgo&end-date=1daysAgo☆t-index=11&max-results=10","profileInfo":{"profileId":"xxxxxx","accountId":"xxxxxx","webPropertyId":"xxxxxx","internalWebPropertyId":"xxxxx","profileName":"xxxxxx","tableId":"xxxxxx"},"containsSampledData":false,"columnHeaders":[{"name":"value1,"columnType":"input1","dataType":"STRING"},{"name":"value2","columnType":"input1","dataType":"STRING"},{"name":"value3","columnType":"input1","dataType":"STRING"},{"name":"value4","columnType":"input4","dataType":"STRING"},{"name":"value5","columnType":"input1","dataType":"STRING"},{"name":"value6","columnType":"input1","dataType":"STRING"},{"name":"value7","columnType":"input2","dataType":"INTEGER"}],"totalsForAllResults":{"XXX:sessions":"3034"},"rows":[["0007a676-0a92-48b1-a5b9-803d93be667f","US","test page","www.xxxxxx.us","/nl/ns","20170918","0"],["0007a676-0a92-48b1-a5b9-803d93be667f","CN","Installment","www.xxxxxx.CN","/nl/plat","20170918","0"],["0007a676-0a92-48b1-a5b9-803d93be667f","CH","Profession","www.xxxxx.CH","/nl/pro","20170918","0"],["0007a676-0a92-48b1-a5b9-803d93be667f","IN","Achievement,","www.xxxxx.in","/","20170918","1"],
Any inputs on what kind of groovy script needs to be added to get desired structure.
Thanks and regards,
Dinesh.
Request clarification before answering.
The easiest is to put a content modifier (with expression) to insert the root element in the body, e.g. like this:
{
"root":
${body}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
60 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.