Actions on JSON tab
In the Robot
Recorder View, the JSON tab displays a JSON input or variable as a tree structure. Use the context
menu to interact and work with it by adding steps to the Robot workflow.
Also, you can add steps directly from the Robot workflow. See JSON steps.
To open a JSON value in a tab in the Recorder View, go to the State pane, right-click the required Input or Variable value, and select Open JSON. The following actions are supported.
|
Action |
Availability |
Description |
|---|---|---|
|
Extract Value To |
Always available. |
Select New Variable to create a new variable, or select an existing variable. Adds a Convert Value step that converts the value to the target variable type. |
|
Update Value |
Available if the variable is writeable (not an Input and not a variable that is currently being looped over). |
Adds an Assign step with the path to the selected node in the Variable box. For example, a[0].name |
|
Remove Element |
Available on elements in an array. |
Adds an Assign step with an expression to remove the required element. For example, a.remove(0) |
|
Remove Key |
Available on keys in an object. |
Adds an Assign step with an expression to remove the required key. For example, a[0].remove("name") |
|
Find Objects with Key |
Available on keys in an object. |
Select Store in New Variable to create a new variable , or select an existing variable. Adds a Find JSON Object step. The key is specified in the Search Condition expression, such as $object.hasKey("name"). The selected or created variable is specified in the Store Result In box. |
|
Find Objects with Key and Value |
Available on keys in an object. |
Select Store in New Variable to create a new variable , or select an existing variable. Adds a Find JSON Object step. The key and value are specified in the Search Condition expression, such as $object.hasKey("name") && $object.name == "John Smith".json().The selected or created variable is specified in the Store Result In box. |
|
Find Objects with Key |
Available on objects. |
Select one of the suggested keys, select Store in New Variable or any existing variable. Adds a Find JSON Object step. The selected key is specified in the Search Condition expression, such as $object.hasKey("name"). The selected or created variable is specified in the Store Result In box. |
|
Sort Objects By |
Available on arrays containing objects, or on objects that are in an array. |
Select one of the suggested keys, select Store in New Variable or any existing variable, select Ascending or Descending. Adds a Sort JSON Array step that sorts by the selected key, in the selected order. |
|
Sort Objects By |
Available on keys in objects that are in an array. |
Select Ascending or Descending. Adds a Sort JSON Array step that sorts by the key, in the selected order. |
|
Sort Elements |
Available on arrays containing numbers or strings, or on numbers or strings that are in an array. |
Select Ascending or Descending. Adds a Sort JSON Array step that sorts in the selected order. |
|
Loop > Child Elements |
Available on arrays. |
Adds a configured JSON Loop step with the Elements in array loop mode. |
|
Loop > Sibling Elements |
Available on elements in an array. |
Adds a configured JSON Loop step with the Elements in array loop mode. |
|
Loop > Child Properties |
Available on objects. |
Adds a configured JSON Loop step with step with the Key/value in object loop mode. |
|
Loop > Sibling Properties |
Available on properties on an object. |
Adds a configured JSON Loop step with step with the Key/value in object loop mode. |
|
Loop > All Descendant Objects |
Available on arrays and objects. |
Adds a configured JSON Loop step with All objects loop mode. |
|
Expand All |
Available on all nodes. Disabled on leaf nodes. |
Expands the selected node and all its descendants. |
|
Collapse All |
Available on all nodes. Disabled on leaf nodes. |
Collapses the selected node and all its descendants. |
|
Copy > Copy JSON |
Available on all nodes. |
Copies the JSON. |
|
Copy > Copy Value |
Available only on nodes of simple type (Text, Number, Boolean). |
Copies the value of the JSON. Note that for JSON Text, Copy JSON copies the text string with quotes, while Copy Value copies only the value (without the quotes). |
|
Copy > Copy Path |
Available on all nodes except the source node (because the path would be empty). |
Copies the path to the JSON value. |