Array Contains
Category: Processing
Description: Checks whether a given value exists in an array and outputs both a boolean result and the zero-based index of its first occurrence (-1 if not found).
Related Modules
Text Array
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Array | text-array | true | The array to search within |
| Value | text | true | The text value to search for |
Outputs
| Name | Type | Description |
|---|---|---|
| Contains? | boolean | Whether the array contains the value |
| Index | number | The zero-based index of the value, or -1 if not found |
Output Event Triggers
| Name |
|---|
| Success |
| Error |
Examples
Check if keyword is in list
Inputs
-
Array:
["apple","banana","cherry"] -
Value:
"banana"
Outputs
-
Contains?:
true -
Index:
1
Number Array
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Array | number-array | true | The array to search within |
| Value | number | true | The number value to search for |
Outputs
| Name | Type | Description |
|---|---|---|
| Contains? | boolean | Whether the array contains the value |
| Index | number | The zero-based index of the value, or -1 if not found |
Output Event Triggers
| Name |
|---|
| Success |
| Error |