Skip to main content

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

InputTypeDescriptionDefault
ListDataThe list from which to extract the first element. Accepts any array type.-

Outputs

OutputTypeDescription
OutputDataThe 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.

  1. Connect a Search node (or any node outputting a list of results) to the List input of First In List.
  2. The Output socket will contain the first document from the search results.
  3. Connect the Output to 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.