Introduction

Completed

In this module, you'll continue working on the accident tracking application.

Note

If you haven't completed the previous modules within this learning path, download the packaging files. These files contain the completed work on the accident tracking app thus far.

Previously, using a Microsoft Excel workbook to track accidents gave users one location to view, review, and add new accident records. The goal of building a model-driven app is to achieve the same concept. It will package all tables, views, and forms into a business application where users can complete all activities that are related to accident tracking.

The best way to get familiar with model-driven apps is to create a solution within Power Apps. A solution is a package that can contain Dataverse tables, forms, views, apps, flows, and other components. By building your model driven-app in a solution, you can easily move it to other environments or preserve a copy in your source control repository. During the app creation process, you'll learn more about the different components of Microsoft model-driven apps and how to work with the new app editor.

The concept of the model-driven app is to have one business application where app users can review and update all records that are related to a business process. In this module's scenario, you'll create a model-driven app where users can view and update employees, locations, accident types, and report accidents efficiently.

Create a new model-driven app

To create a new model-driven app, follow these steps:

  1. Go to make.powerapps.com and sign in with your Microsoft credentials.

  2. Select Solutions > + New solution.

  3. In the New solution pane under Display name, enter Accident Tracking. Under Publisher, select the environment that you wish to create the solution. Then select Create.

    Screenshot of the solution creation page with, Solutions highlighted in the navigation pane and the Display name and Publisher fields highlighted in the New solution pane.

  4. Next, we want to add our tables to the solution. Select Add existing from the command bar and select Table from the dropdown.

  5. In the Add existing tables panel, search for and add the following tables to the solution:

    • AccidentTable

    • EmployeeTable

    • LocationTable

    • TypeofAccidentTable

      Once you select all four tables, select the Next button.

  6. Make sure you select Include all objects for each table, to ensure we bring in the data. Then select the Add button to complete adding them to the solution.

  7. After a few moments, your tables will appear as Tables inside your Accident Tracking solution. Next we'll create a Model-driven app. To do so, go to the command bar and select + New > App > Model-driven app.

  8. Give your app a name. For this exercise, name it Accident Tracking Application.

  9. Give your app a description to help users understand the general purpose and usage of the app. Let's enter: Application to keep track of employee accidents.

  10. Select Create. After a few moments, your new app will appear in the app designer screen.

    Screenshot of the newly created app in the app designer.

  11. Let's add a page to your app. Select the prompt button on the canvas to Add page.

  12. A New page popup appears prompting you to choose the page content. We'll start with a Dataverse table (default selection). Select Next to continue.

  13. At this point, we'll select our AccidentTable which should be near the top of the list, and leaving the toggle on for Show in navigation, select Add.

  14. Your AccidentTables view appears on the left side Pages panel under a header called New Group in the Navigation section. Go ahead and select New Group there. In the New Group Display options panel on the right side of the screen, under Title, lets's rename it Accident Tracking. As you change it, you'll notice that New Group becomes Accident Tracking, and that change reflects in the app screen as well.

    Screenshot of the Navigation Group properites tab, showing Accident Tracking entered in the Title field.

  15. Now that we have a proper group name of "Accident Tracking", let's fix the name of AccidentTables to make a more meaningful name. In the Pages panel under Navigation, select AccidentTables view (it's directly under the newly renamed Accident Tracking group). In the AccidentTables panel on the right side of the screen, select the Settings tab. Let's change the Title to "Accidents". Did you notice that your navigation title changed?

    Screenshot of the app with the title of AccidentTables changed to Accidents and the updated view of our app.

  16. Go to the top right of the command bar and select Publish to both save and publish your app. (Save merely saves and Publish does both.)

  17. Take a moment to Play your app to review what you've accomplished so far.

    • Accident Tracking is the Group, and the Home page.

    • Accidents is the view just under Accident Tracking

    • MainAccidentTrackingView on the canvas shows our accident data in the MainAccidentTrackingView that we created previously.

You now have a fully functioning model-driven app! Let's continue to build on our app in the next unit.