Practice Lab 2 - Data model

Scenario

In this lab, you will create Dataverse tables, columns, and relationships.

Contoso Real Estate wants to track two key elements:

  • Real estate property listings
  • Who is scheduled for showings of real estate properties

What you will learn

  • How to create tables in Dataverse
  • How to add columns to Dataverse tables
  • How to create relationships between tables

High-level lab steps

  • Create tables
  • Create columns
  • Create relationships

Prerequisites

  • Must have completed Lab 1: Publisher and solution

Detailed steps

Exercise 1 - Create tables

In this exercise, you will create and add tables to the solution.

Task 1.1 – Create Real Estate Property table

  1. Navigate to the Power Apps Maker portal https://make.powerapps.com

  2. Make sure you are in the Dev One environment.

  3. Select Solutions.

  4. Open the Property listings solution.

  5. Select + New and then select Table and select Table (advanced properties).

    Screenshot of new table pane

  6. Enter Real Estate Property for Display name. The plural name will be automatically populated.

  7. Select the Primary column tab.

  8. Enter Property Name for Display name.

  9. Expand Advanced options, review the available options but don’t change anything here.

    Screenshot of table primary column tab

  10. Select the Properties tab.

  11. Expand Advanced options.

  12. Check Creating a new activity.

  13. Check Appear in search results.

    Screenshot of table advanced options

  14. Select Save.

  15. Select Properties.

    Screenshot of Real Estate Property table

  16. Check Enable attachments and select Save.

Task 1.2 – Create Showing table

  1. In the Objects pane, select All.

  2. Select + New and then select Table and select Table (advanced properties).

  3. Enter Showing for Display name. The plural name will be automatically populated.

  4. Expand Advanced options.

  5. Check Appear in search results.

  6. Select Save.

Task 1.3 – Create Open House table

  1. In the Objects pane, select All.

  2. Select + New and then select Table and select Table (advanced properties) again.

  3. Enter Open House for Display name. The plural name will be automatically populated.

  4. Expand Advanced options.

  5. Select Organization for Record ownership.

  6. Select Save.

Task 1.4 – Add contact table

  1. In the Objects pane, select All.

  2. Select Add existing and choose Table.

  3. Select the Contact table.

  4. Select Next.

  5. Select Add.

Exercise 2 - Create columns

In this exercise, you will create columns to the tables to the solution.

Task 2.1 – Create Real Estate Property columns

  1. Navigate to the Power Apps Maker portal https://make.powerapps.com

  2. Make sure you are in the Dev One environment.

  3. Select Solutions.

  4. Open the Property listings solution.

  5. Select the Real Estate Property table.

  6. Under Schema, select Columns.

  7. Select + New column.

    Screenshot of new column pane

  8. Enter Asking Price for Display name.

  9. Select Currency in the Data type drop-down.

  10. In the Required drop-down, select Business required.

  11. Select Save.

  12. Select + New column.

  13. Enter Street for Display name.

  14. In the Required drop-down, select Business required.

  15. Select Save.

  16. Select + New column.

  17. Enter City for Display name.

  18. In the Required drop-down, select Business required.

  19. Select Save.

  20. Select + New column.

  21. Enter Bedrooms for Display name.

  22. Select Choice in the Data type drop-down and select Choice again.

    Screenshot of new choice column pane

  23. Select Yes for Sync with global choice.

  24. Select + New choice.

    Screenshot of new global choice pane

  25. Enter Number of Rooms for Display name.

  26. Enter 1 for Label and 1 for Value.

  27. Select + New choice and Enter 2 for Label and 2 for Value.

  28. Select + New choice and Enter 3 for Label and 3 for Value.

  29. Select + New choice and Enter 4 for Label and 4 for Value.

  30. Select + New choice and Enter 5 for Label and 5 for Value.

    Screenshot of completed global choice pane

  31. Select Save.

  32. In Sync this choice with select Number of Rooms.

  33. Select Save.

  34. Select + New column.

  35. Enter Bathrooms for Display name.

  36. Select Choice in the Data type drop-down and select Choice again.

  37. In Sync this choice with select Number of Rooms.

  38. Select Save.

Task 2.2 – Create Showing columns

  1. In the Objects pane, select All.

  2. Select the Showing table.

  3. Under Schema, select Columns.

  4. Select + New column.

  5. Enter Showing Date for Display name.

  6. Select Date and time in the Data type drop-down.

  7. Select Date only in the Format drop-down.

  8. In the Required drop-down, select Business required.

  9. Select Save.

  10. Select + New column.

  11. Enter Comments for Display name.

  12. Select Text in the Data type drop-down and then under Multiple lines of text, select Plain text.

  13. Select Save.

  14. Select + New column.

  15. Enter Level of Interest for Display name.

  16. Select Choice in the Data type drop-down and select Choice again.

  17. Select No for Sync with global choice.

  18. Enter Very High for Label.

  19. Select + New choice and Enter High for Label.

  20. Select + New choice and Enter Medium for Label.

  21. Select + New choice and Enter Low for Label.

  22. Select + New choice and Enter No interest for Label.

  23. Select Save.

  24. Select + New column.

  25. Enter Shown by for Display name.

  26. Select Lookup in the Data type drop-down and select Lookup again.

  27. In the Related table drop-down, select User.

  28. Select Save.

Task 2.3 – Create Open House columns

  1. In the Objects pane, select All.

  2. Select the Open House table.

  3. Under Schema, select Columns.

  4. Select + New column.

  5. Enter Open House Date for Display name.

  6. Select Date and time in the Data type drop-down.

  7. Select Date only in the Format drop-down.

  8. In the Required drop-down, select Business required.

  9. Select Save.

Exercise 3 - Create relationships

In this exercise, you will create relationships between the tables to the solution.

Task 3.1 – Real Estate Property to Contact relationship

  1. Navigate to the Power Apps Maker portal https://make.powerapps.com

  2. Make sure you are in the Dev One environment.

  3. Select Solutions.

  4. Open the Property listings solution.

  5. Select the Real Estate Property table.

  6. Under Schema, select Relationships.

  7. Select + New relationship and then select Many-to-one.

  8. In the Related (One) Table drop-down select Contact.

  9. Enter Client for Lookup column display name.

  10. In the Lookup column requirement drop-down, select Business Required.

  11. Select Done.

Task 3.2 – Real Estate Property to Showing relationship

  1. Select + New relationship and then select One-to-many.

  2. In the Related (Many) Table drop-down select Showing.

  3. In the Lookup column requirement drop-down, select Business Required.

  4. Select Done.

Task 3.3 – Real Estate Property to Open House relationship

  1. Select + New relationship and then select One-to-many.

  2. In the Related (Many) Table drop-down select Open House.

  3. In the Lookup column requirement drop-down, select Business Required.

  4. Expand General.

  5. Enter realestateproperty_openhouse for Relationship name.

  6. Select Done.

Task 3.4 – Showing to Contact relationship

  1. In the Objects pane, select All.

  2. Select the Showing table.

  3. Under Schema, select Relationships.

  4. Select + New relationship and then select Many-to-one.

  5. In the Related (One) Table drop-down select Contact.

  6. Enter Shown to for Lookup column display name.

  7. Select Done.