Skip to main content

JSON.Add

Adds a key-value pair to a JSON object.

Syntax​

JSON.Add *JSON_to_add_value_to "key" value

Returns​

reference to JObject object

Arguments​

NameRequiredTypeDescription
JSON to add value toYesa reference to JObject object.
keyYesAny text e.g. "Hello, World!"You will be using this key to refer to this value, like { "key": value }
valueYesa value of type LiteralValue

Possible errors​

  • Provided value was not able to be added to the JSON object.

On a running server​

Use serhelp JSON.Add to inspect the reference generated by your installed SER version.