Elena Humeniuk
PPM Consultant
Model-driven apps are solid solutions for enterprises seeking structured and data-driven apps. This article will focus on creating and managing model-driven apps with Power Apps and Dataverse, when to utilize them, and how to secure these applications.
What Is a Model Driven PowerApp?
A model-driven app is one of the application types you can develop in PowerApps using a component-centric no- or low-code approach.
Such an app is developed using data from a cloud-based database called Microsoft Dataverse. The app employs a designer tool to incorporate forms, charts, dashboards, views, and charts into tables.
A model-driven application includes:
- Data.
- Security at the granular level.
- UI and logic.
- Integration with other Power Platform apps.
- Extension by code.
It differs from a canvas app as the latter is more flexible and allows you to design the user interface from scratch.
When to Use Model-Driven Apps
Model-driven apps are best used in processes involving organizational data that must be stored in a database. This includes:
- Case management. Create case tracking and management apps to ensure a systematic approach to internal processes or customer issues.
- Project management. Develop apps for project management, with tables representing tasks, resource allocation, and milestones.
- Compliance tracking. You can build apps to monitor and ensure compliance with internal policies or industry regulations.
- Sales pipeline management. Use these apps to streamline the sales pipeline, which includes tracking leads, customer interactions, and opportunities.
- Customer relationship management. These applications provide a structured approach to handling customer data and interactions.
Minimum Requirements for Creating Model-Driven Apps
Model-driven apps may be complex, but the minimum requirements for creating them are pretty straightforward:
- An MS Power Apps license.
- A Power Platform environment.
- A Dataverse database in the environment.
- Privileges for the designer to work as an environment maker where the model-driven app is created.
- A table. (Several standard tables exist by default)
- One table view for viewing records. (There are a number by default.)
- One table column. (Each table has at least one column and several system columns.)
- One table form for entering data. (There will be one form by default.)
How to Build a Model-Driven Application in PowerApps
At a basic level, model-driven app development consists of the following stages.
Set up Dataverse
The first stage in building a model-driven app is to define your data model by setting up Dataverse. This involves:
- Tables: These are the tables that store your data. For example, you might have Customers, Orders, and Products in a customer management app.
- Columns: Each table contains fields (columns) that store specific pieces of information. For example, the Customers entity might have fields like Customer Name, Email, and Phone Number.
- Relationships: Define how entities relate to one another. For instance, a Customer can have multiple Orders, creating a one-to-many relationship between the Customers and Orders entities.
To create tables and columns in Dataverse:
- Navigate to the Power Apps portal.
- Select Dataverse from the left-hand menu.
- Choose Tables and then New Table to create a new one.
- Add fields to your entity by selecting the entity and choosing Add Column.
Once the tables and columns have been created, you should add relationships. Within the table settings, navigate to the Relationships tab. Click on Add Relationship and choose the type of relationship you want to create:
- One-to-Many
- Many-to-One
- Many-to-Many
You can then define the relationship properties, such as:
- Provide a meaningful name for the relationship.
- Lookup Field. Specify the field that will be the foreign key linking the related entity.
- Set the cascading rules for actions like delete, assign, and share.
Compose the app
Building a model-driven app involves a series of steps:
Step 1. Log in to PowerApps
Purchase Microsoft PowerApps separately or as part of Office 365 or Microsoft 365. You must log into your account to begin building an app.
Step 2. Start a New App
When you are logged into the PowerApps environment, go to the Create tab to start a new app. Choose the model-driven app to create an application based on data structures.
Step 3. Define Data Entities
Model-driven apps are based on data entities. Specify these entities to set up the fundamental data model on which your application will be based. Define the relationships between the entities in a way that will depict the business processes.
Step 4. Design User Interface
Dataverse automatically creates a user interface from the data entities that have been specified. Organize the layout, forms, and views to fit your organization’s requirements for an interface. Be sure to take advantage of the design features already incorporated into the design to improve the user experience.
Step 5. Configure Business Logic
Use the Power Platform’s business processes and rules to define the app’s logic. Model-driven apps enable the definition of business processes, resulting in a consistent and efficient workflow.
Step 6: Test and Deploy
Carefully test the model-driven app in the Power Apps environment to guarantee smooth operation. Once verified, you can make the app available for organizational usage.
Share the App
To share a model-driven app, you will need to perform two actions:
- Assign a security role to the user. This implies that the user has the permission to see the data.
- Share the app link with the users. To get this link, edit the app and choose the Properties tab before copying the Unified Interface URL.
- Then, paste the URL in a location to allow your users to access it. For example, email it or post it on a SharePoint site.
How to Apply Business Logic to Model-Driven PowerApps
You can apply logic to your data using four main components: business process flows, Power Automate, business rules, and background workflows. These offer different features, and employing all four in a single model-driven app is possible.
Business process flows ensure a sequence of steps the user must follow when entering data into the app. A business process flow could be added in a case management-based app to ensure that users always go through the same stages. This helps maintain the standard of the process for all users and cases.
Business rules offer essential server-side business logic to form in a model-driven app. A business rule can make a column visible, invisible, active, or inactive. It can also set or clear the value of a column and make a column validated and mandatory.
Power Automate is a different Power Platform app with native integration through its numerous Dataverse connectors. This allows for many kinds of automation. For instance, updating related tables or sending users notifications is possible. There are three types of Power Automate flows: scheduled, automated, and instant.
Background workflows also offer automation, but unlike Power Automate, they don’t offer a user interface. While most of the features provided by background workflows are now available in Power Automate, a few are still unavailable. These include wait conditions for columns.
How to Secure Your Model-Driven Apps
Dataverse has a rich security model with tools that enable you to set up a security model that will be optimal for each specific business process scenario.
Security roles are the foundation of security access in Dataverse and the whole Power Platform. A security role is a level of access provided to the individual users assigned to that role. It is possible to assign a user to several security roles.
The main principle of Dataverse security is that all the privileges a user gets through the security roles are combined. A user receives all the privileges that all the roles grant. This happens even if one role cancels another, with the highest privilege being considered.
Privileges are Create, Write, Delete, Read, Append, Assign, Append To, and Share across an access range of Organizations, Users, and Business Units and Users. This means much room for fine-tuning, table record access, and modification settings.
Dataverse for teams is also a practical part of security. You can create a team, or more accurately, a selected group of users, give it a relevant name, and then assign security roles. This makes it easier to manage access from an admin perspective and allows for logical grouping of users. In the security settings, you can create Teams.
Where discretion is required for specific columns, it is possible to set up column-level security. This level of security limits the user’s ability to view data in a particular column. This column needs a security profile, which you can assign to a user or a team of users. This scenario is most appropriate when the records contain personal or financial data.
Extensibility and Integration of a Model-Driven Power App
You can connect model-driven apps to all other applications in the Power Platform. In addition to utilizing Canvas apps and Power Automate integration, you can create Power BI reports and dashboards using Dataverse as the data source and display within the app.
You may also incorporate and analyze third-party application data in an app since external data can be imported to Dataverse using virtual tables.
Finally, there are numerous possibilities to expand an app through custom development by developing components or integrating JavaScript as plugins to offer more features.
Conclusion
Microsoft model-driven apps is a subcategory of PowerApps that provides a more structured and data-focused approach to application development to create solutions that improve efficiency and meet business goals. For the IT manager, model-driven apps are a valuable solution for solving your organization’s problems and achieving success. This guide allows you to create and manage model-driven apps using PowerApps and Dataverse.
Learn more about
automated Dataverse backup and restore solution