Exercise - Modify table views

Completed

In this exercise, you'll modify the views for LocationTable and TypeofAccidentTable. The end goal will be to modify the existing view and add the columns of data that are most relevant to the app user into one list.

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.

Modify the view for LocationTable

Follow these steps to modify the view for LocationTable:

  1. From the Power Apps home page, select Tables.

  2. Find and select the custom LocationTable.

  3. Select Views and then select the Active LocationTables view.

  4. By default, this view already has the LocationId column and the Created On column. Remove the Created On column from the view.

  5. Add the LocationName and LocationCountry columns to the view. Your view should have three columns now in the following order: LocationId, LocationName, and LocationCountry.

    Screenshot of table columns for LocationTable.

  6. Select Save and Publish to save and publish your changes.

Modify the view for TypeofAccidentTable

To modify the view for TypeofAccidentTable, follow these steps:

  1. From the Power Apps home screen, select Tables.

  2. Find and select your table TypeofAccidentTable.

  3. Select Views and then select the Active TypeofAccidentsTables view to open the view designer studio.

  4. Add the columns AccidentName and AccidentSeverity. When complete, your view should resemble this image:

    Screenshot of active TypeofAccidentsTables view.

  5. Select Save and Publish.

Modify the view for AccidentTable

The process for modifying the view for AccidentTable is similar to the previous exercise steps. The difference with this process is that you'll use the relationships built in the previous learning module to display information in the same view from the related tables. Consider this process as similar to flattening the information to display in a tabular style view information for each accident, such as:

  • Location name of the accident

  • Type of accident name

  • Type of accident severity

  1. From the Power Apps home page, select Tables.

  2. Find and select AccidentTable.

  3. Select Views and then select the Active AccidentTables view to open the view designer studio.

  4. Add the columns: AccidentDescription, ManagerComments, AccidentDate, and ManagerReviewed.

  5. To add fields from the related table, select the Related tab from under the Table columns panel. The Related tables are tables that have a relationship with this table. By default, all tables in Dataverse have standard relationships with other standard tables, such as the User table. (The image below step 8 below shows numbers to help you locate this step and the next three.)

  6. Find and select LocationId (LocationTable), this action expands to show the fields from the LocationTable. Select LocationName and LocationCountry from the list.

  7. Let's add some more related columns to our view. Under the Related columns, find and select AccidentTypeId (TypeofAccidentTable). Select AccidentName and AccidentSeverity from the list.

  8. Change the name of this view to MainAccidentTrackingView. When complete, your table columns will resemble the image below (though you might not have any data in your table).

    Screenshot of the updated Main Accident Tracking View.

  9. Select Save and Publish to complete the exercise.

You can now use all three of these views in any model-driven app that you build with these tables. The first two views were straightforward, and the third view incorporated views from related tables. A keen advantage of using Dataverse is the ability to natively incorporate related tables into your views. Next we'll learn how to modify forms based on our tables.