How to generate JSON
I am having hard time generating valid JSON from a Excel file with Keys and values. Here is the sample input and expected output. Please send your suggestions.
Input:
id attributename attributevalue
1 merged FALSE
1 haschildrencode {"Value":1}
1 owninguser {"Id":"100","LogicalName":"systemuser","Name":null}
Output:
ID JSON OUTPUT
1 {
"merged":"FALSE",
"haschildrencode":{"Value":1},
"owninguser":{"Id":"100","LogicalName":"systemuser","Name":null}
}
Thank you for the help.
-
Official comment
Checkout the JSON_MAP function. It takes a json array of keys and a json array of values:
https://documentation.datameer.com/documentation/current/JSON_MAP
Comment actions -
Thank you. TO be more specific - we have to use TOJSON(GROUPCONCAT(AttributeName)) and same for AttributeValue and then have to use JSON_MAP on the outputs. But JSON_MAP is converting quotes in the data to \u0026quot
I am not sure if there is a way to fix it but this will sure help me to proceed.
thanks
Please sign in to leave a comment.
Comments
3 comments