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.
Canvas apps embedded on model-driven forms contain a special control named ModelDrivenFormIntegration. This control is responsible for bringing contextual data from the host model-driven form to the embedded canvas app.
Important
To be able to interact with the ModelDrivenFormIntegration control, the canvas app must be created by selecting Customize on the Canvas app control properties for the model-driven form using the classic form designer. More information: Embed a canvas app using the classic experience
This article explains the properties and actions available on the ModelDrivenFormIntegration control. This control is available to customize in Power Apps Studio when you create the canvas app using the Canvas app control properties UI in the classic form designer.
mod
| Property or action | Description |
|---|---|
| DataSource | Should be set to the data source connected to the parent table of the host model-driven form. Automatically set when embedding a new canvas app. When embedding an existing canvas app, ModelDrivenFormIntegration data source can be configured from the canvas app tree view. The value for DataSource should always refer to the table of the form the app is embedded in. The value shouldn't be filtered or modified in any way. |
| Item | Read-only property that enables the embedded canvas app to access the row from the host model-driven form. As an example, to get the value of a column with the name accountnumber and display name Account Number, you can use ModelDrivenFormIntegration.Item.accountnumber or ModelDrivenFormIntegration.Item.'Account Number'. |
| OnDataRefresh | The formula in this property is evaluated when the host model-driven form saves data. Use it to refresh the data source connected to the parent table of the host model-driven form and to perform other actions like setting or updating variables. As an example, setting it to the formula below will refresh the Accounts data source and set a variable named CurrentAccountNumber to the value of the Account Number column of the current row. Refresh(Accounts); Set(CurrentAccountNumber, ModelDrivenFormIntegration.Item.'Account Number') The OnDataRefresh action should only be used to refresh data within the embedded canvas app. We don’t recommend that you use the OnDataRefresh action to save changes within the embedded canvas app. More information: Saving data in an embedded canvas app |
| RefreshForm | Refreshes the data on the host model-driven form. See Perform predefined actions on the host form for details. |
| SaveForm | Saves the data on the host model-driven form. See Perform predefined actions on the host form for details. |
| NavigateToMainForm | Navigates the host model-driven form to a main form and displays the specified row. See Perform predefined actions on the host form for details. |
| NavigateToView | Navigates the host model-driven form to a view. See Perform predefined actions on the host form for details. |
| OpenQuickCreateForm | Opens the default quick create form for an table. See Perform predefined actions on the host form for details. |
| Data | Read-only property used by the framework to send some key data from the host model-driven form to the embedded canvas app. Do not use this property. Use Item to access the row from the host model-driven form. |
ModelDrivenFormIntegration control data is not available on app start
The ModelDrivenFormIntegration.Item property isn't guaranteed to be populated with data when the app starts. The app should either be designed to wait for this data using an expression like !IsBlank(ModelDrivenFormIntegration.Item), or the app should explicitly retrieve the record using an expression like LookUp(Accounts, Account = GUID(First(ModelDrivenFormIntegration.Data).ItemId)).
See also
Embed a canvas app on a model-driven form
Add an embedded canvas app on a model-driven form
Perform predefined actions on the host form from within an embedded canvas app
Share an embedded canvas app
Guidelines on working with embedded canvas apps