Exercise – Create a canvas app with Copilot in Power Apps

Completed

In this exercise, you’ll create a mobile application by using Copilot in Microsoft Power Apps. Field agents will use this app to browse real estate inventory and manage appointments for showings, and the data will be stored in Dataverse.

Note

Power Apps requires a Microsoft 365 license or a free trial. Learn more about your licensing options. Microsoft products include Power Apps and Power Automate.

Note

In this lab, your results for data might vary from those shown in the screenshots. This is because Copilot uses OpenAI to generate data dynamically.

Note

On the top of the Power Apps Home page, you may see a Try the new data experience toggle - make sure this is toggled off.

Create a canvas app with natural language

  1. On the Home page in Power Apps, in the center text input field, enter the following prompt to search for an AI-generated table:

    build an app to manage real estate showings

    Screenshot of Copilot in Power Apps with text prompt text field, enter arrow, and try the new power apps experience toggle highlighted.

  2. Select the Send button.

  3. A screen will display the table(s) and relationships that Copilot created. You can see that it can create sophisticated data relationships. In this example, we only need the Showing table. To remove the other tables:

    1. Click on the ellipsis (...) next to the table name
    2. Select Remove
    3. Select Remove from the Remove table popup that appears on the screen

    Alternatively, you can select the table and select the Remove button in the command bar.

    Screenshot of tables and relationships with the ellipsis next to the Property table and the Delete selection highlighted.

  4. In the Showing table, click on the ellipsis (...) and select View data.

    Screenshot of tables and relationships with the ellipsis next to the Showing table and the View data selection highlighted.

  5. Review the table that opens at the bottom of the screen to view the columns that were created.

    Screenshot showing a generated table based on your prompt.

    Your next steps are to modify and add to the already generated table.

Modify the Generated Table

  1. First let's change the name of the table to Real Estate Showing. In the Copilot prompt input text box (in the bottom of the Copilot pane to the right of the screen), enter the following text:

    Please change the name of the Showing table to Real Estate Showing

    If your table has a different name, adjust the prompt accordingly.

  2. If the table lacks a column for the full client name, add one by entering:

    Please add a column to the Real Estate Showing table called Client Name

    Select the Send button or your Enter key.

    Copilot notifies you that the table is updated, and the new column should be added to the table.

  3. To add a column for client email, enter:

    Please add a column to the Real Estate Showing table to track client email

    Select the Send button.

    A new column is added to the table that displays each client’s email.

    Screenshot of the newly generated Client Email column with Copilot prompt, response, and new column highlighted.

    Note

    The data that's generated in your table might vary from the data that's shown in the table in the screenshots for this lab.

    On the right of the screen, it appears as if you're having a conversation with a Copilot while adding to and modifying your table. This area is where you can scroll through and view the changes or additions that you've made to your table.

    Screenshot showing Copilot conversation history.

  4. Edit the Status column within the table.

    Note

    If the Status column does not exist, add it using the following prompts:

    • In the Real Estate Showings table, add a Status column.
    • Please update the choices in the Status column to be Pending, Confirmed, and Cancelled
    • Set the default choice of the Status column to Pending

    To add another choice option called "Completed" to the Status column, enter:

    Please add another choice option to the Status column called “Completed”

  5. Confirm the changes by selecting the drop down arrow next to Status and then selecting Edit column.

    Screenshot of the Status column drop down edit column.

  6. The system might take a minute to load. When it does, the Status column shows as updated and includes the option for Completed.

    Screenshot of the Status column properties with the updated choices.

    Note

    If your column choices aren't the same as the ones that are shown in the screenshot, enter the following prompt into the Copilot input text box and enter:

    The status choices should be Pending, Confirmed, Cancelled, and Completed

    Next, you'll add more data to your table and the existing columns.

Add Data to the Table and Finalize Columns

  1. To add more data, enter the following prompt:

    Please add 5 more rows of data to the Real Estate Showings table

    Five more rows of data are added for each existing column in the table.

  2. To ensure that you have the columns needed to continue on this learning path, ensure your table includes the following columns:

    • Showing ID
    • Address
    • Date and Time
    • Status
    • Agent Name
    • Client Full Name
    • Client Email

    Use the Copilot Chat panel to adjust your table to match this list. Delete any unnecessary columns and ensure all rows have data. If not, prompt Copilot to add the missing data.

    Note

    Ensure that the Showing ID column contains four-digit numbers starting with 1001.

Create the App

  1. Once your table is ready, select the Save and open app button from the top of the design canvas.

  2. The app may take a few minutes to load. If a dialog appears saying, "Welcome to Power Apps Studio," select Skip.

    The app that has been built for you should open in Edit mode.

    Screenshot of the generated app in Power Apps Studio.

Modify the Properties/Showings table

  1. Select the Data icon from the left navigation bar. Copilot has created a Dataverse table now displayed in the Data section.

    Screenshot of the Dataverse table called Properties in the Data panel of Power Apps Studio.

    Note

    Currently, Copilot supports only Dataverse. It won't build tables in other data sources at this time.

  2. To edit the table:

    1. Hover over the table in the Data pane
    2. Click the ellipsis (...) and select Edit data.

    Screenshot showing the action of selecting the Edit data option.

  3. In the Edit table dialog, you can add your own columns to the table or modify existing columns.

    Screenshot of the Edit table dialog with the Real Estate Properties data.

  4. Select the Showing ID column header from the table.

  5. From the dropdown menu, select the Edit column option.

    Screenshot showing the action of editing a column within the Edit table dialog.

  6. In this example, you don't want the Data type to be a Single line of text. To change that value, go to the Edit column pane, and then from the Data type dropdown menu, select # Autonumber.

  7. Select Save.

    Screenshot highlighting the Autonumber data type and the Save button.

  8. Select the Close button in the lower-right corner of the Edit table dialog.

    The table should now show as Refreshed in the Data pane.

    Screenshot showing that the Real Estate Showings table has been refreshed.

Modify the canvas app user interface

  1. Modify the gallery in the application to display relevant data:

    1. Select the Tree view icon to return to the Tree view
    2. On the app's Showings screen, select RecordsGallery1 to display Real Estate Showing
    3. Select the edit button to put the gallery in edit mode
  2. Update the fields:

    1. Title: Set the Text value to ThisItem.Address
    2. Subtitle: Set the Text value to ThisItem.'Client Email'
    3. Body: Set the Text value to ThisItem.Status

    A single record in the gallery should now resemble the following image.

    Screenshot of a single record in the Real Estate Showings Gallery.

  3. On the app's main screen, select the Form control.

    Screenshot of the selected form control from the app's main screen.

  4. On the Properties pane on the right, under the Fields property, select Edit fields.

    Screenshot showing the Edit fields option on the Properties pane.

  5. In the Fields pane, expand the Showing ID field.

  6. From the Control type dropdown menu, change the type to View text.

    Screenshot showing the action of changing the ID control type to View text.

    Note

    Since the Showing ID field to Autonumber, users should not enter their own numbers. Dataverse automatically generates these numbers.

  7. Close the Fields pane by selecting the X in the upper-right corner.

Add a New Property Request

  1. Select the Play button from the upper part of the screen.

    Screenshot of the Play button in Power Apps Studio.

  2. In the left pane, select the +New button.

    Screenshot highlighting the add New record button in Power Apps Studio.

  3. Fill in the fields with the following information:

    • Agent Name - < Your name >
    • Client Full Name - < Your name >
    • Client Email - < Your email >
    • Date - < Any future date >
    • Time - < Any future time >
    • Status - Pending
    • Address - 210 Pine Road, Portland, OR 97204

    Note

    This address is from the Microsoft Excel file in Module 1, which you uploaded and turned into the Real Estate Properties table. Although you'd usually have a lookup field to the Real Estate Properties table, this lab omits it for simplicity.

  4. Select the check mark in the upper-right corner of the screen to save your changes.

    Screenshot of the completed form, showing the check mark that you select to save your changes.

  5. Select the X in the upper-right corner to close out of the app.

    If a dialog appears saying Did you know?, select OK.

    The new request is added to the list of requests in the screen's left hand pane.

  6. From the upper part of your screen, select the Save button to save the new app. (If the save button is greyed out, your changes have already been saved. After the first save, canvas apps autosave every two minutes.)

    Screenshot of the Save button in Power Apps Studio.

    If the system prompts you, save the app name as Real Estate Showings.

  7. Exit the app to return to the Power Apps home page.