API ReferenceGE Extensionsflowgraphnodesutil
Get Table Value By Key (Flowgraph Node)
- **Node Name:** `Get Table Value By Key`
Overview
- Node Name:
Get Table Value By Key - Category:
repeat_instant - File:
extensions/flowgraph/nodes/util/getTableValueByKey.lua
Retrieves a value from a table using a given key (string or number).
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
value | table (generic) | The table to look up |
key | string or number | The key to retrieve the value for |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | any | The value found at the given key |
Internals
Key Methods
| Method | Description |
|---|---|
work() | Performs table[key] lookup and outputs the result, or nil if table is absent |
How It Works
- Checks if the input table exists.
- Indexes the table with the provided key:
table[key]. - If the result is non-nil, outputs it. Otherwise outputs
nil. - If the table input itself is nil, explicitly sets output to
nil.
Usage Example
-- Look up a vehicle property:
-- [Get Vehicle Data] → table → [Get Table Value By Key] key="model"
-- → value → [Display Model Name]
-- Access array element by index:
-- [Get Waypoints] → table → [Get Table Value By Key] key=3
-- → value → [Use Third Waypoint]Key Dependencies
None - pure Lua table indexing utility.
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide