07-30-2019 05:57 AM
Hi Team,
I want to remove the square brackets and extra curly braces in the given json file to convert the json file to expression file. My input file is as below.
[
{
“Test”: {
“xyx”: “x”,
“abc”: “a”,
“pqr”: “p”
}
},
{
“Test1”: {
“opq”: “o”,
“stu”: “s”,
}
}
]
But I want to convert the above file as below.
{
“Test”: {
“xyx”: “x”,
“abc”: “a”,
“pqr”: “p”
},
"Test1": {
"opq": "o",
"stu": "s"
}
}
Any suggestions like how I can achieve this.
08-26-2019 10:07 PM
I’d also be interested in the solution to this issue.
In my pipeline I use a File writer, and the file payload is not contained in square brackets, but when I work with the file in Snaplogic I see that a set of square brackets has been added, which contains the entire payload/file content. This set of brackets disrupts the downstream workflow when attempting to Rest Post.
edit: this post resolved my issue - adding the content-type to the HTTP Header in my Rest Post snap
How to change default array document structure? - #2 by ddangler
04-20-2022 07:27 AM
You can check this out for solution: Removing curly brackets after using "to.String()" across a group of fields