First In List
Uncontrolled node
Overview
The First In List node extracts and returns the first element from an input list. This is useful when you need to access the initial item of a collection, such as the first result from a search query, the first row of a table, or the first item in a filtered list.
If the input is not a valid list or is empty, the node returns null.
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| List | Data | The list from which to extract the first element. Accepts any array type. | - |
Outputs
| Output | Type | Description |
|---|---|---|
| Output | Data | The first element of the input list (index 0). Returns null if the input is not an array or if the array is empty. |
Runtime Behavior
The node evaluates the List input at runtime. If the input is a valid non-empty array, it outputs the element at index 0. If the input is null, undefined, not an array, or an empty array, the output will be null.
This node is uncontrolled, meaning it executes automatically whenever its input data changes and does not require an event trigger to run.
Example Usage
Scenario: Retrieve the first search result from a list of documents.
- Connect a Search node (or any node outputting a list of results) to the
Listinput of First In List. - The
Outputsocket will contain the first document from the search results. - Connect the
Outputto a Show node or process it further (e.g., extract specific fields using Get Value).
[Search Node] → results (list) → [First In List] → output (first item) → [Show Node]
If the search returns no results (empty list), the First In List node will output null, which can be handled by an If node to check for empty results.