Zoomed Image

AMSX Scripting Language - Command : JsonSet

Summary

Set a property or array element in the active AMSX JSON object

Description

Navigates to the node identified by the JSONPath in cmd and assigns a value. For object nodes, arg 0 names the child property to set. For array nodes, leave arg 0 blank to clear the array, supply an integer to replace that element, or any other text (e.g. "add") to append. Name-value pairs from arg 2 onward are used to replace %placeholder% tokens within the value string before assignment.

Parameters

ParameterDescription
cmdJSONPath selector for the parent node to update
Argument 0child property name (for objects), integer index (for arrays), "add" to append (for arrays), or blank to clear an array
Argument 1value to assign; may contain %name% tokens replaced by subsequent argument pairs
Argument 2first token name to replace in the value (token appears as %name% in arg 1)
Argument 3replacement value for arg 2 token, then further name/value pairs follow

Syntax


JsonSet "JSONPath selector for the parent node to update", "child property name (for objects), integer index (for arrays), "add" to append (for arrays), or blank to clear an array", "value to assign; may contain %name% tokens replaced by subsequent argument pairs", "first token name to replace in the value (token appears as %name% in arg 1)", "replacement value for arg 2 token, then further name/value pairs follow"

Return to the AMSX Command Reference