Skip to main content

List: Index Of

Return the 0-based position of the first occurrence of a needle in an input list, or -1 when the needle is not found. Mirrors JavaScript's Array.prototype.indexOf.

The needle can be supplied either statically via the Value parameter or dynamically via the value input connector (the connector wins).

Example
Value: 30
Input: [10, 20, 30, 40]
Output: 2

Value: 99
Input: [10, 20, 30, 40]
Output: -1

Parameters

Value

Static fallback needle used when the value input connector is not wired or arrives empty. When unset and no input is provided, the step fails.

Input

ArrayREQUIRED

List to search (Array or JSON array).

Value

Needle to look for. Overrides the Value parameter when wired.

Output

Result

0-based index of the first occurrence, or -1 when absent.