Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Determines whether the specified set contains the specified element.
Syntax
set_has_element(set, value)
Learn more about syntax conventions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| set | dynamic |
✔️ | The input array to search. |
| value | ✔️ | The value for which to search. The value should be of type long, int, double, datetime, timespan, decimal, string, guid, or bool. |
Returns
true or false depending on if the value exists in the array.
Example
print arr=dynamic(["this", "is", "an", "example"])
| project Result=set_has_element(arr, "example")
Output
| Result |
|---|
| true |
Related content
Use array_index_of(arr, value) to find the position at which the value exists in the array. Both functions are equally performant.