Skip to main content
Version: ACE 4

JSON Clean

Overview​

JSON Clean allows removing nodes from doc context.

This is useful when you want to delete some properties (clean up the doc context) or just remove a couple of properties before returning them in the flow result.

Configuration​

  • paths to remove it is possible to add multiple paths to be removed from doc nodes (they will be executed from first to last)
note

Paths can be both upper level node and lower level nodes node.subnode, node.subnode.subnode, etc

Examples​

Here we will create a sample flow that has input document with values we want to keep and remove.

note

Please note that the JSON Clean does not have Target path configuration, so in the example flow we have used JSONATA Map to copy all the values in doc context to result

Step configuration​

Paths to remove

  • remove
  • object.remove

Input​

Input Schema
{
"keep": "Apple",
"remove": "Nails",
"object": {
"keep": "Banana",
"remove": "Screws"
}
}

Result​

As you can see the values that were marked in the step as removable were removed.

Input Schema
{
"doc": {
"keep": "Apple",
"object": {
"keep": "Banana"
},
"result": {
"keep": "Apple",
"object": {
"keep": "Banana"
}
}
},
"errors": []
}

Example flow​

JSON Clean Example Flow
{
"name": "exampleJsonClean",
"flow": {
"name": "exampleJsonClean",
"description": "",
"steps": [
{
"stepType": "clean-object",
"color": "rgba(154,183,211,0.6)",
"displayName": "JSON Clean",
"isSelected": true,
"config": {
"paths": [
{
"removePath": "remove"
},
{
"removePath": "object.remove"
}
]
}
},
{
"stepType": "jsonata",
"color": "rgb(245,210,211)",
"displayName": "JSONATA Map",
"isSelected": false,
"config": {
"maps": [
{
"mergeArrayItems": {},
"jsonata": "$",
"targetPath": "result"
}
]
}
}
]
},
"inputSchema": {
"keep": "Apple",
"remove": "Nails",
"object": {
"keep": "Banana",
"remove": "Screws"
}
},
"createDate": "2021-10-08T16:35:39.994Z",
"id": 1633710940137
}