Category: Transform / Web
This action modifies aspects of a JSON object. Commands this action can run are: Change property value, Add property, Delete property, Rename property, and Reformat JSON.
Setting | Description |
---|---|
Column | Select the column that contains the JSON to be modified. |
Command | Select the modification to run on the selected JSON. Options: Change property value, Add property, Delete property, Rename property, or Format JSON. See below for the details of each command. |
If the node doesn't exist | Choose how EasyMorph will handle cases when the selected node doesn't exist in the dataset. Options: Fail (the workflow halts execution with a warning) or Ignore (the workflow continues). |
Description: Changes the value of the select JSON path (key).
Setting | Description |
---|---|
JSON Path | Select the path/key to change the value of. |
Replace with* | Enter the value to be inserted. |
The inserted values are dates | Check this option on if the values are dates. |
* Setting can be specified using a parameter.
Description: Adds a new property under the selected Parent node.
Option | Description |
---|---|
Parent | Select the node to insert the new property under. |
Node name* | Enter the name of the new property. |
Node value* | Enter the value of the new property. |
The inserted values are dates | Check this option on if the values are dates. |
* Setting can be specified using a parameter.
Description: Removes a property from the JSON in the selected column.
Option | Description |
---|---|
JSON Path | Select the node to remove the property from. |
Description: Renames a property in the selected JSON path.
Option | Description |
---|---|
JSON Path | Select the path to be renamed. |
New name | Enter the new name of the selected path. |
Description: Converts the format of the JSON text from a single-cell string to a tree structure, or the reverse.
Option | Description |
---|---|
Make readable | This option converts the JSON from a single-cell text value to a more readable nested structure. |
Minimize size | This option converts the JSON from a nested structure to a single-cell text value. |
Wildcards like "$" (for root node), and "[*]" (for an array) can be used where JSON Paths and nodes need to be selected/entered.
Change property value: Change the "name" property's value from "Doug" to "Alex".
{ "name":"Doug", "id":7, "dept":"Accounting" }
{ "name":"Alex", "id":7, "dept":"Accounting" }
JSON Path is "name"
Replace with "Alex"
If the node doesn't exist: Fail
Add property: Add the new node "age".
{ "name":"Doug", "id":7, "dept":"Accounting" }
{ "name":"Doug", "id":7, "dept":"Accounting", "age":50 }
Parent: $ (root node)
Node name: age
Node value: 50
If the parent node doesn't exist: Fail
Delete property: Remove the "id" property.
{ "name":"Doug", "id":7, "dept":"Accounting" }
{ "name":"Doug", "dept":"Accounting" }
JSON Path: id
If the node doesn't exist: Fail
Rename property: Rename the "id" property to "ident".
{ "name":"Doug", "id":7, "dept":"Accounting" }
{ "name":"Doug", "ident":7, "dept":"Accounting" }
JSON Path: id
Replace with: ident
If the node doesn't exist: Fail
Format JSON (minimize size): Consolidate the JSON structure into a single line.
{ "name":"Doug", "id":7, "dept":"Accounting" }
{"name":"Doug","ident":7,"dept":"Accounting"}
Minimize size
Format JSON (Make readable): Expand the single-line JSON into a multi-line format.
{"name":"(insert name)","ident" 7,"dept":"Accounting"}
{ "name":"Doug", "id":7, "dept":"Accounting" }
Make readable