Skip to main content

Update node

Change one value in JSON, found by its path; a list there can be replaced or added to.

Command in the JSON toolkit · id ooa.json/update_node · 7 inputs (1 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
ValueAnyNoDictionary, List or JSON text (or use an open JSON session).
PathStringYesPath of the node to change.
NodeAnyNoNew value.
Create if missingBooleanNofalseAdd the key when it does not exist instead of failing.
Value typeStringNoas_givenType the new value gets in the JSON: as given, text, a number, true/false, JSON (text such as {"a": 1} becomes an object or list) or null.
If listStringNoreplaceWhen the node at the path is a list: replace the whole list with the new value, or add the new value (each item of a new list) at its end.
SessionStringNoWork on the document of this JSON session (Start session) instead of a value; changes stay in the session until End session saves them.

Outputs​

OutputTypeWhat it is
valueAnyUpdated document.
previousAnyThe value that was replaced.