Forum Discussion

NAl's avatar
NAl
Contributor
4 years ago
Solved

Using JSON Splitter to reorganise JSON

Is it possible to move ValueX so it sits in the corresponding original document?
I’m currently using a JSON splitter to flatten a file processed by a Group by snap upstream.

{
    "original": {
    "Individual": "Wolverine"
}
     "ValueX":
      "9999"
}

Here is the current JSON splitter setup:
![Screen Shot 2021-08-27 at 11.27.57 AM|650x342](upload://p7caZIF2OIIPeT91yz3EfPqBScH.png)

2 Replies

  • Hi @NAl ,

    You can use Structure snap to move one field to another.

    Result

  • Supratim's avatar
    Supratim
    Contributor III

    @NAl you can use the below syntax $.extend($.get(“original”)).filter((value, key) => key != “original”) to keep all your attribute under root. It will help you to avoid using $original. in your downstream snaps.