Index In List
Uncontrolled node
Overview
The Index In List node searches for a specific value in a list and returns:
- A boolean indicating if the value was found (
true
orfalse
) - The index of the first occurrence of the value (or
-1
if not found)
This node is helpful for conditional logic, validation, or locating where a value appears in a dataset.
Inputs
Input | Type | Description | Default |
---|---|---|---|
List | List | The list to search through | - |
Value | Any | The value to find in the list | - |
Outputs
Output | Type | Description |
---|---|---|
Found | Boolean | true if the value exists in the list, otherwise false |
Index | Number | The position of the first occurrence of the value, or -1 if not found |
Panel Controls
No additional configuration is required. This node uses standard equality checks to compare list items to the input value.
Example: Value Found
List:
["apple", "banana", "cherry"]
Value:
"banana"
Output:
- Found:
true
- Index:
1
Example: Value Not Found
Value:
"grape"
Output:
- Found:
false
- Index:
-1
Tip
This node only returns the index of the first match. If the value appears multiple times, only the first one is returned.