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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Value | Any | No | Dictionary, List or JSON text (or use an open JSON session). | |
| Path | String | Yes | Path of the new node; its parent must exist. Use - or the list size to append. | |
| Node | Any | No | Value to insert. | |
| If exists | String | No | error | When the key already exists: fail with JSON.NODE_EXISTS, replace its value, or leave it. |
| Create parents | Boolean | No | false | Create missing parent dictionaries on the way. |
| Value type | String | No | as_given | Type 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. |
| Session | String | No | Work on the document of this JSON session (Start session) instead of a value; changes stay in the session until End session saves them. |
Outputs
| Output | Type | What it is |
|---|---|---|
| value | Any | Updated document. |