<<.from-version "5.3.2">> The <<.op jsonset>> operator is used to set a property value in JSON strings. See [[JSON in TiddlyWiki]] for background. See also the following related operators:
The type of the value to be assigned to the property can be optionally specified with a suffix:
* ''string'': default, the string is specified as the final operand
* ''boolean'': the boolean value is true if the final operand is the string "true" and false if the final operand is the string "false", any other value for the final string results prevents the property from being assigned
* ''number'': the numeric value is taken from the final operand, invalid numbers are interpreted as zero
* ''json'': the JSON string value is taken from the final operand, invalid JSON prevents the property from being assigned
* ''object'': an empty object is assigned to the property, the final operand is ignored
* ''array'': an empty array is assigned to the property, the final operand is ignored
* ''null'': the special value null is assigned to the property, the final operand is ignored
Properties within a JSON object are identified by a sequence of indexes. In the following example, the value at `[a]` is `one`, and the value at `[d][f][0]` is `five`.
The <<.op jsonset>> operator uses multiple parameters to specify the indexes of the property to set. When used to assign strings (default behaviour if no suffix is specified) the final operand is interpreted as the value to assign.
In the special case where only a single parameter is defined, the operator replaces the entire input object with the the value of that parameter. If the single parameter is blank, the operation is ignored and no assignment takes place.