Put
Add or replace the value for a key.
Command in the Dictionary toolkit · id ooa.dictionary/put · 5 inputs (2 required), 3 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Dictionary | Dictionary | Yes | Source dictionary. | |
| Key | String | Yes | Key to set; added when the dictionary does not have it yet, its value replaced when it does (keys are case-sensitive). | |
| Value | Any | No | Value. | |
| Only if missing | Boolean | No | false | Keep the existing value when the key is already there. |
| Position | Number | No | G1 (AA parity): where a new key goes, counted from 0 (0 = first); at the end when empty. A key already there keeps its place. |
Outputs
| Output | Type | What it is |
|---|---|---|
| dictionary | Dictionary | Updated dictionary. |
| previous | Any | The value the key had before, empty when the key is new. |
| existed | Boolean | True when the key was already there. |