Map size
Description
Pure function returning the number of entries in a map. A null map counts as empty and returns 0.
When to use
Use Map size to know how many entries a map holds before deciding what to do next — for example, branching on whether a lookup table built earlier in the pipeline ended up empty. Because it is a pure generic node, it works with any map’s key and value types. A null map counts as empty and returns 0, exactly like leaving the pin unconnected.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Map | generic{generic} | — | The map whose entries to count. Key and value types resolve at design-time from the connected source. A null map — for example an optional map field that arrived as JSON null — counts as empty, exactly like leaving the pin unconnected. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Result | integer | The number of entries in the map. 0 for an empty or null map. |
Example
Abort the pipeline if a map built by earlier Map put calls never received any
entries. Wire the map local variable into the Map input of Map size, then feed the
Result output into Equals (B set to 0), and connect the Result output of Equals to
the Condition input of Branch. The True execution output routes to Fail; the False
output lets the rest of the pipeline run.