Record.FieldOrDefault
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Returns the value of a field from a record, or the default value if the field does not exist.
Record.FieldOrDefault(record as record, field as text, optional defaultValue as any) as any
| Argument | Description |
|---|---|
| record | The Record to check. |
| field | The field to return. |
| optional defaultValue | The default value to return if the field does not exist. |
Record.FieldOrDefault([CustomerID =1, Name="Bob"], "Phone") equals null
Record.FieldOrDefault([CustomerID =1, Name="Bob"], "Phone", "123-4567") equals "123-4567"
Show: