title | description | author | ms.topic | ms.custom | ms.reviewer | ms.date | ms.subservice | ms.author | search.audienceType | contributors | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Defaults function |
Reference information including syntax and examples for the Defaults function. |
gregli-msft |
reference |
canvas |
mkaur |
3/22/2024 |
power-fx |
gregli |
|
|
Applies to: :::image type="icon" source="media/yes-icon.svg" border="false"::: Canvas apps :::image type="icon" source="media/yes-icon.svg" border="false"::: Model-driven apps
Returns the default values for a data source.
Use the Defaults function to pre-populate a data entry form, making it easier to fill.
This function returns a record that contains the default values for the data source. If a column within the data source doesn't have a default value, that property won't be present.
Data sources vary in how much default information they provide, including not providing any at all. When you work with a collection or another data source that doesn't support default values, the Defaults function will return an empty record.
You can combine the Defaults function with the Patch function to create a record.
Defaults( DataSource )
- DataSource – Required. The data source for which you want default values.
Formula | Description | Result |
---|---|---|
Defaults( Scores ) | Returns the default values for the Scores data source. | { Score: 0 } |
[!INCLUDEfooter-include]