I need to create json files whose root are an array (starts with [), in the format as follows: [object, object, ...].
But for JSONWriter mapping, the root is an element (object) which starts with {.
Is there any simple way to make JSON root to be an array instead?
I could manually remove the root and array name in the output file, or use a script to do it outside CloverETL. But that is not convenient, especially for large number of json files to create.
Reference:
http://stackoverflow.com/questions/3833 ... -json-text
But for JSONWriter mapping, the root is an element (object) which starts with {.
Is there any simple way to make JSON root to be an array instead?
I could manually remove the root and array name in the output file, or use a script to do it outside CloverETL. But that is not convenient, especially for large number of json files to create.
Reference:
http://stackoverflow.com/questions/3833 ... -json-text
-
Hi,
The following are the steps to take to accomplish you use case:- Delete default root element
- Add child array (this will be your new root)
- In the item element that is created, drag and drop input fields
The below image is an example of how the mapping should look.
json_mapping.PNG -
Thanks for the very quick reply, Pedro.
It is sorted! I did not realise I could delete the root.
Please sign in to leave a comment.
Comments 2