Reader small image

You're reading from  Learn Microsoft Power Apps - Second Edition

Product typeBook
Published inSep 2023
PublisherPackt
ISBN-139781801070645
Edition2nd Edition
Right arrow
Authors (2):
Matthew Weston
Matthew Weston
author image
Matthew Weston

Matthew is a Microsoft 365 & SharePoint specialist from the Midlands in the United Kingdom. He has spent several years working in various Consultancy roles. Matthew is the Managing Director of Vantage 365, which fuels his love of working on projects surrounding Microsoft 365, especially those that involve SharePoint, Microsoft Teams, Power Apps, and Power Automate. This could be helping businesses find solutions for their problems or offering training to help people use these technologies better. Matthew leads the Black Country Power Apps & Power Automate user group, and the Office 365 & SharePoint User Group in the West Midlands. Matt is a Microsoft Most Valuable Professional in the field of Business Applications.
Read more about Matthew Weston

Elisa Bárcena Martín
Elisa Bárcena Martín
author image
Elisa Bárcena Martín

Elisa Bárcena Martín is currently a project leader at LogiRAIL, having previously worked as a business apps specialist at Intelequia and a project analyst at GlaxoSmithKline. As a Power Platform enthusiast with more than 3 years of experience with the Power Platform, she has steadily grown from her initial role as a developer into her project leader position. She is a scientist and teacher by vocation, loving process optimization and believing in continuous improvement and learning.
Read more about Elisa Bárcena Martín

View More author details
Right arrow

Creating Model-Driven Apps

In the previous chapter, we learned that model-driven apps are designed to share the same type of development principles as canvas apps, in that you can create apps that are simple or complex in nature without the need to write code.

This chapter will go further into the creation of model-driven apps, so you can understand how and when to use them. The whole approach to model-driven apps is different from that of canvas apps in that we need to define more of our functionality around the data, and define it upfront before we start to build. Therefore, we will need to be aware of what these building blocks are and how we can use them. Finally, when we have our foundations in place and the building blocks ready, we can start to combine them all together to create our app.

In this chapter, we will look at how we can create a model-driven app. Model-driven apps are based on a Dataverse relational database, which makes these kinds of applications particularly...

Technical requirements

This chapter involves working with premium components of the Power Platform; therefore, you will either need to sign up for the Power Apps Developer Plan (https://powerapps.microsoft.com/en-us/developerplan/) or have a Power Apps per-app/per-user plan license assigned to you (https://powerapps.microsoft.com/en-us/pricing/).

Introducing views, forms, and dashboards

In the previous chapter, we really focused on creating the data elements of our tables. Now, we will look at the other features that will start to feed into our model-driven app – views, forms, and dashboards:

  • Views: Views allow you to create predefined filters on the records within the table, which makes the queries more efficient when we use Dataverse as a data source within model-driven apps.
  • Forms: In the same way in which we can create views of the data for model- driven apps, we can also define forms for inputting, editing, or viewing the data.
  • Dashboards: Dashboards allow you to create preconfigured graphical representations of the data using multiple controls.

We should always keep in mind the differences in approach between creating a model- driven app and creating a canvas app. With model-driven apps, you ideally need to consider what your views and other components are going to be before you...

Creating a model-driven app from scratch

The process of creating a model-driven app starts off in the same way as the process of creating a canvas app: we first navigate to the Power Apps maker portal. The option that we need is next to Canvas App on the app selection screen and is titled Model-driven App. When we create a new model-driven app, the editing experience starts to change immediately.

Unlike when we created a canvas app, there is no mention of whether we are developing it for a mobile or tablet. Instead, we now need to shift our mindset into creating just a single app that is responsive to both being viewed in browsers and on mobile devices.

We can create a model-driven app in the following way:

  1. The initial creation of the model-driven app shares some similarities with the creation of canvas apps. Such similarities include being able to define what the name of the app is and the description. After you enter those fields and click Create, the app will...

Using your model-driven app

First, we should publish the app, and then we can click Play to launch it. This will allow us to interact with the app within the browser in the same way that we can with canvas apps.

Once you have launched your app, you will be faced with your working model-driven app. This is where it becomes apparent to users that we are extremely limited in terms of what we can do with the look and feel of the app; it is the price to pay for it being so quick to design. This lack of design freedom really means that model-driven apps are better suited to back-office functions. We will now run the app so that we can see the user interface:

  1. Click the Play button in the top-right corner of the model-driven app designer window to see the app in fullscreen mode.
  2. Click on one of the navigation items on the left of the screen. This will then display the data contained within the table in the center of the screen.
  3. After clicking on Accounts, we will...

Feedback

We are constantly looking at improving our content, so what could be better than listening to what you as a reader have to say? Your feedback is important to us and we will do our best to incorporate it. Could you take two mins to fill out the feedback form for this book and let us know what your thoughts are about it? Here's the link: https://forms.office.com/r/STtMpJAhFS.

Thank you in advance.

In the previous chapters of this book, we have used several data sources that are external to the Power Platform. We are now going to explore Microsoft Dataverse (https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-intro), a data source that underpins the Power Platform applications and provides a robust, yet simple, method for storing data in a way that feels very similar to creating tables within a database.

We have already learned about canvas apps as we've progressed through this book; now, it is time to introduce another kind of Power Apps application...

Technical requirements

This chapter is working with premium components of the Power Platform; therefore, you will either need to be working in a community plan, sign up for the Power Apps Developer Plan, or have a Power Apps Plan 1 per app/per user plan license assigned to you.

Understanding the Dataverse

The Dataverse, which until November 2020 was known as Common Data Service (CDS), is a data source that is available to the Power Platform and that allows you to store data in a structure that shares a lot of similarities to a database. The data is structured in tables (previously known as entities) that use columns (previously known as fields) to hold and structure the data very much like a database table that you expect to see in something as simple as a Microsoft Access database.

The Dataverse enables users to share data across several different applications within Microsoft 365 including Power Apps, Microsoft Power Automate, Power Virtual Agents, Power BI and Power Pages. Unlike other data sources, to use the Dataverse, we do not need to provide specific connection information as the underlying database is automatically connected to the environment where the app exists.

The Dataverse allows you to build relationships between tables. Most developers within...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learn Microsoft Power Apps - Second Edition
Published in: Sep 2023Publisher: PacktISBN-13: 9781801070645
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Matthew Weston

Matthew is a Microsoft 365 & SharePoint specialist from the Midlands in the United Kingdom. He has spent several years working in various Consultancy roles. Matthew is the Managing Director of Vantage 365, which fuels his love of working on projects surrounding Microsoft 365, especially those that involve SharePoint, Microsoft Teams, Power Apps, and Power Automate. This could be helping businesses find solutions for their problems or offering training to help people use these technologies better. Matthew leads the Black Country Power Apps & Power Automate user group, and the Office 365 & SharePoint User Group in the West Midlands. Matt is a Microsoft Most Valuable Professional in the field of Business Applications.
Read more about Matthew Weston

author image
Elisa Bárcena Martín

Elisa Bárcena Martín is currently a project leader at LogiRAIL, having previously worked as a business apps specialist at Intelequia and a project analyst at GlaxoSmithKline. As a Power Platform enthusiast with more than 3 years of experience with the Power Platform, she has steadily grown from her initial role as a developer into her project leader position. She is a scientist and teacher by vocation, loving process optimization and believing in continuous improvement and learning.
Read more about Elisa Bárcena Martín