Embed a Canvas App in the model driven app

How to embed a canvas app in your model driven app

Do you want to create a button in the forms in your model driven app? You could embed a Canvas App in your model driven app to do this.

Create a solution

I will start this post my creating a solution in Power Apps. This solution will hold the canvas app that I’m creating and the Model Driven App that I’m about to create.

First I’m going tot add the Account table as I want to add a Canvas app to the form for the Account.

Now I’m adding a column called Canvas App to my table. You could use any required column you like. For this post however I created a new column.

Create A Canvas App

I will create a simple canvas app inside my solution and I’m adding a button to this app. Once I’ve save and published the app, I have an app that will look like this:

Now that I have a canvas app and a column that will hold my app I can create a new model driven app.

Create a model driven app

My model driven app will only have the Accounts table included. You will probably find that in your apps you might have more tables included. It all depends on which tables/entities you want to use to embed a canvas app in.

Note that in my site map I’m selecting for the Entity the Account table.

Then I can edit the form for my table.

Connect a Column with a Canvas app

In the forms editor you will notice the add component option. In the Microsoft documentation the same options are also shown in the classic interface, but there is no real need to use the classic UI anymore.

Now it is time for the exciting part of this post. Embed a Canvas app into your Model driven app.

Embed a Canvas App

There are 3 options here. You could for example store the App id of the canvas app in a column and then use this to start your app. Just imagine starting a different app depending on where you are in your process.

I’m going to use the easiest option whereby I’m setting the app id to a hard coded value.

First I will need to collect the App id of the Canvas app. By selecting Details from the apps menu.

now I will get to the following screen where the App Id is shown.

A Quick copy and past of the app id will now help me to embed a canvas app in my model driven app.

Embed a Canvas App

Now I just need to publish the solution and test the app.

Test the App

Now when I open an account in my models driven app I can see that my Canvas app is appearing.

In this post I only added a button which for example could start a flow, but of course there are a lot more options available within your Canvas apps.

How are you planning to use this? Let me know and leave a comment below. I’m interested to hear your stories.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: