This function is used to set an item referenced by the directed path. The directed path field can be an object element or an indexed array item. The path must end with .name or [index]]. examples:
object.name object.list[4] [2]
In the above indexed array items examples, the index must be greater or equal to zero and less that the number of items in the array. A special form of the index exists where the index can be preceded by an @ character. This implies insert at the specified index. When the @ form is used, the index can be equal to the number of items in the array and the statement is equivalent to an Add Item to Container Array statement (with more limited source types).
All text fields in the statement can contain any of the escape sequences defined in Escape Sequences.
The action test state will be set to true if there are no errors. The action test state will be false if any errors occurred. Named variable Container Error will contain the errror text. If the Stop action on error option is enabled, the action will be terminated with an error message in the case of an error.
You must select a data type to identify how the data field is formatted. The available data types are:
Pre-existing items are overwritten.
Example:
{ "areaCodes" : [ 416, 647, 0 ], "location" : { "place" : "unknown" } }
Assume the above JSON is represented in a container named sample. The following statements...
Set the container item at 'sample.location.place' to string 'Toronto' Set the container item at 'sample.location.province' to string 'Ontario' Set the container item at 'sample.areaCodes[2]' to number '999' Set the container item at 'sample.areaCodes[@0]' to string '???'
will result in the following:
{ "areaCodes" : [ "???", 416, 647, 999 ], "location" : { "place" : "Toronto", "province" : "Ontario" } }