Insert JSON

This action inserts a new property (name/value pair) into a JSON object or a new item into a JSON array.

The step action only works on JSON variables.

Properties

The Insert JSON action can be configured using the following properties:

Insert What:
This defines what to insert, whether it is a new property in an object or a new item in an array. The two options are:
Object Property:
This option defines a new property to insert. If this option is used then the found JSON value must be an object otherwise an error is produced. The new property is defined by the two properties:
Name:
This is the name of the new property. This must of course be a valid property name, e.g. quotation marks should be escaped.
Value:
This is the value of the property which must be a valid JSON value, e.g. if you want to insert a text this must be quoted.
Item Array:
This option defines a new item to insert. If this option is used then the found JSON value must be an array otherwise an error is produced. The new property is defined by the two properties:
Value:
This is the value of the item which must be a valid JSON value, e.g. if you want to insert a text this must be quoted.
Insert Where:
Choose where to insert the new JSON relative to the found JSON value. The options are:
Before:
This will insert the property or item before the found JSON.
First:
This will insert the property or item as the first property in a JSON object or array.
Last:
This will insert the property or item as the first property in a JSON object or array.
After:
This will insert the property or item after the found JSON.