JSON and Step Actions

A number of steps work only on JSON; the data presented in the current window must be JSON (and not JSON in the legacy format where JSON has been translated into XML). These steps are found in the step category called JSON in the Step Action Selector on the Action tab of the Step View. But the easiest way to select them is to use the context menu (right-click menu) in the Applications View when the current window contains JSON. See the following sample image.


JSON step example

Two steps can extract from a JSON value:

  • Extract JSON. This step always extracts a JSON value. For exampl, if the selection in the view is a property, it is the value of the property that is extracted. It is in many ways similar to the Extract step that extracts from HTML and XML, except that it is simpler because of the simpler data format; no distinction exists between markup and text.
  • Extract Property Name. This step extracts the name of a property.

Two steps can loop over a JSON text:

Both of steps will for each iteration set a part of the JSON value in question as named JSON (similar to a named tag). This cannot be global when iterating over a variable, as changing the value of a variable during the iteration may change the value in such a way that iteration may fail, such as if an item is removed from the list iterated over.

Four steps can modify JSON (only if the JSON is in a variable):

  • Set JSON. Replaces the selected part of a JSON value with a new JSON value.
  • Set Property Name. Sets the property name to a new name on a selected property.
  • Insert JSON. Inserts a new property in a JSON object or a new item (JSON value) in a JSON array. There are several options on where to insert the new property or item, such as first or last. Consult the reference documentation for the step for a full list.
  • Remove JSON. Removes the selected part of a JSON value, such as a property from a JSON object or an item from a JSON array.

Finally, two more steps work on JSON:

  • Test JSON. This step tests the "type" of a JSON value to determine whether it is an object, array, string, etc.
  • Set Named JSON. This step is similar to its corresponding step for other types of data, such as Set Named Tag and Set Named Range. It defines a named reference to a part of a JSON value so that it can be used as a reference when finding other parts of a JSON value in subsequent steps. Shown as blue boxes in the view.