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.
In this article
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Takes a column name as a string and a default value. Returns a reference to the column if it exists, otherwise - returns the default value.
Deprecated aliases: columnifexists()
column_ifexists(
columnName,
defaultValue)
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
columnName | string |
✔️ | The name of the column to check if exists. |
defaultValue | scalar | ✔️ | The value to use if the column doesn't exist. This value can be any scalar expression. For example, a reference to another column. |
If columnName exists, then the column it refers to. Otherwise defaultValue.
// There's no column "Capital" in "StormEvents", therefore, the State column will be used instead
StormEvents | project column_ifexists("Capital", State)