Skip to main content

Insert node

Add a value to JSON: a new key, or an item in a list at a position such as order.items[1].

Command in the JSON toolkit · id ooa.json/insert_node · 7 inputs (1 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
ValueAnyNoDictionary, List or JSON text (or use an open JSON session).
PathStringYesPath of the new node; its parent must exist. Use - or the list size to append.
NodeAnyNoValue to insert.
If existsStringNoerrorWhen the key already exists: fail with JSON.NODE_EXISTS, replace its value, or leave it.
Create parentsBooleanNofalseCreate missing parent dictionaries on the way.
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.
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.