Map put
Description
Puts a key-value entry into a map in place and returns the updated map. Works on maps of scalars and maps of arrays alike — the value pin follows the map's value shape. Has execution pins (not pure).
When to use
Use Map put to add or update entries in a map — for example, building a lookup table inside a loop or collecting key-value pairs from an API response. The node mutates the map in place and outputs the updated reference. If a key already exists, the value is overwritten.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Map | generic{generic} | — | The map to insert into. Key and value types resolve at design-time from the connected source. |
| Key | generic | — | The key for the entry. Must match the map's key type. |
| Value | generic | — | The value to associate with the key. Must match the map's value type. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Map | generic{generic} | The same map after the entry has been inserted or updated. |
Execution pins
| Pin | Direction |
|---|---|
| In | Input |
| Out | Output |
Example
Inside a For each loop over an array of items, wire each item’s ID as the Key and the item itself as the Value into Map put. Wire the local variable map into the Map input and the output Map back into a local variable set to persist the change for the next iteration. After the loop, the map contains every item keyed by ID.