Array node
Array Length
Get the number of elements in an array. A lightweight utility that reports the array size and whether it is empty — useful for conditional logic and loop control.
Inputs
| Port | Type |
|---|---|
| ArrayThe list to measure. Cable any array stream here; nothing connected simply reports a count of 0. | any |
Outputs
| Port | Type |
|---|---|
| Count | int |
| Is Empty | bool |
How It Works
Array Length counts the number of elements in the incoming array and outputs the total as Count. If the array has zero elements (or no array is connected), Is Empty outputs true.
This is a pure read operation — the array passes through unchanged.
Use Cases
- Conditional branching: Connect Is Empty to a Switch node to show a "no data" state when the buffer is empty.
- Progress tracking: Compare Count against a target number to calculate collection progress (e.g., "42 of 100 samples collected").
- Dynamic sizing: Feed Count into math nodes to calculate per-element spacing for visualizations that adapt to data length.
- Validation: Check that an array has the expected number of elements before processing it.
Tips
- Array Get also outputs Count, so if you already have an Array Get node you don't need a separate Array Length.
- For detailed statistics beyond just count, use Array Stats instead.
Open Array Length in the interactive catalog →
Array Length is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.