Dataverse is sometimes viewed as a database service, but it’s much more than just tables and views. Also included are apps, forms, processes, workflows, and other built-in and reusable objects that can be used to create and distribute applications.
One such inclusion is Power Apps, and with it the ability to create Canvas and Model-Driven applications. I especially like Model-Driven apps because they allow me to configure a solution based on data model that reflects the business processes that I am trying to support.
Once an application is built, it invariably needs to move between Power Platform environments like “development,” “test,” and “production.” A Dataverse solution is the way that we package our application and all its parts into a single file that can be used for distribution or for application lifecycle management (ALM) processes.
In this post, we will walk through the steps of creating a Dataverse solution that can be moved between environments and explain some of the related concepts along the way. To get started, open Power Apps at https://make.powerapps.com/ and then select your target environment.
Create a new solution
Click Solutions and then click New solution.
Click New publisher. A solution publisher shows who developed the app.
Complete the New publisher form by supplying the following information:
- Display name: This is the publisher’s name shown in the solution
- Name: This is the internal publisher’s name with no spaces or special characters
- Prefix: Gets added to all custom solutions items and will help discern delivered Dataverse items from your custom items
- Choice value prefix: This is a numeric value that gets added to all choice value internal identifiers. These become important when using Power Automate, but are not surfaced on the application front-end
- Contact: This is the default organization information
Click Save to create the new publisher and return to the solution creation screen.
Complete the New solution form by supplying the following information:
- Display name: This is the name shown in the solution
- Name: This is the internal solution name with no spaces or special characters
- Publisher: We created this during our earlier steps.
Click Create to create the new solution.
Our new solution is now available in our environment.
When we click into the solution, we see the default object types like Apps, Chatbots, Cloud flows, and Tables. Clicking Add existing will allow us to import items that we previously created, or leverage items delivered as part of the Common Data Model (CDM). Note: CDM is a part of Dataverse.
For the purposes of this blog post, we will create an app with existing and custom tables to help track customer issues. Click Add existing and then click Table.
Select the Account and Contact (not shown below) tables and then click Next. These two tables are part of the CDM and have preconfigured columns, metadata, forms, views, and relationships that will help us build our solution faster.
Select Include all components for both tables and then click Add. Components include the columns, metadata, views, forms, keys, business rules, and so on.
Create a new table called Source by clicking New and then clicking Table.
Set the Display name to “Source” and select Enable attachments (including notes and files) and then click Save. Note: Dataverse creates a plural name for the table so try to name tables in singular form. Enabling attachments will allow us to use the Timeline control in our Model-Driven app.
Click the Source table and then click Add column to create the following new columns:
Click Save Table to commit your changes.
Click Tables to return to the tables screen.
Create another table called Issue and set the Display name to “Issue” and select Enable attachments (including notes and files) and then click Save.
Note that our publisher prefix is added to the schema name I.e., nys_Issue.
Add the following columns to the Issue table:
Click Save Table to commit your changes.
Now that our data-model is built we can create our model-driven app by clicking Apps, New, App, and then select Model-driven app.
Select the Modern app designer (preview) experience and then click Create.
Enter “Issue Tracker” as the app name and click Create.
We can incorporate our data model into our app by adding Pages. Pages are the views and forms that come as part of Dataverse and require very little customization to deliver an excellent user experience. To get started, click Add page.
Set the page type to Table based view and form and click Next.
Select the Account, Contact, Issue and Source tables and then click Add.
Click Save and then click Publish to finish building the app.
There are many options to further customize the app, table views, and forms. See these articles for more information:
- Understand model-driven app views
- Create and design model-driven app forms
Now that our app is built, let’s export the solution by clicking Export on the Overview section of the solution.
There are two options given to use prior to exporting:
- Publish all changes will promote all changes made to our solution items. This is generally a good idea if all of your changes are complete and ready for use.
- Check for issues is a system check to see if there is anything that is not ready for use.
Click Publish and wait for all items to be published. Click Check for issues and wait for the issue check to complete. You will receive an email notification of any findings with Check for issues. Click Next.
At this point you have the choice to export as:
- Managed: The items within the solution cannot be changed in the destination environment. This is a good for moving validated code to a production environment.
- Unmanaged: The items in the solution can be changed as desired. This is good for sharing code with others.
In this example we will export as Managed. Select Managed and click Export.
After the export file is generated, you can download the file. Click Download to save the solution file locally.
If you were to inspect the export file you would see the XML files that allow the solution to be rebuilt.
XML file snippet shown in the image below.
The process of importing your solution file is straightforward. Select your destination environment in Power Apps, click Solutions, and then click Import.
Click Browse and select your downloaded export file. Click Next.
The Import a solution screen will confirm the details that we specified in the export (name, type, publisher, and version). Click Import to start the process.
The import process can be viewed from the Solutions screen within PowerApps. Notice the grey banner near the top of the screen. It usually takes a few minutes for the import process to complete.
Once complete, the grey banner will turn to green showing a successful import.
Click the Issue Tracker solution and notice that all of our objects have been recreated in our destination environment. Also note that we are not able to edit any of the items directly as they are part of a managed solution.
Play your app to see the Issue Tracker app in action.
Data is not included in the solution export and import process. That’s a blog post for another day.
Dataverse solution files are the cornerstone of Power Platform ALM. Even at a basic level, manually exporting and importing provides a higher degree of maturity than rebuilding applications by hand—or worse, developing in a production environment. Look to Azure DevOps for advanced Power Platform ALM where these mundane tasks are automated.
Have any other topics relating to Dataverse solutions or model-driven apps that you’d like to see covered? Let me know down below!
For all things Microsoft 365 be sure to subscribe to our blog.