Exercise – Create a canvas app with data from an Excel file

Completed

In this exercise, you’ll create a mobile application by using data from an Excel table. Download the RealEstateProperties.xlsx for use in this exercise.

Note

Microsoft 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.

Create a solution

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

    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.

  2. On the left navigation bar, select Solutions.

  3. On the Solutions page, under Current preferred solution, select Manage.

  4. On the Set your preferred solution dialog box, select + New solution.

  5. In the New solution dialog box, enter the following:

    • Display Name: Real Estate Solution
    • Name: RealEstateSolution
    • Publisher: Select a publisher from the dropdown list or create a new one.
    • Version: 1.0.0.0

    Select Create.

    The Real Estate Solution solution is created and populated into the preferred solution dropdown list. Select Apply to set it as the preferred solution.

    Screenshot of the New solution dialog box.

    Note

    A solution is a container that helps you manage and package apps, flows, and other components in the Power Platform.

    Setting a preferred solution is helpful because it allows you to select where your furture updates will be saved so your work stays organized.

  6. On the left navigation bar, select Home to return to the Power Apps home page.

Create a canvas app from an Excel file

  1. On the Power Apps home page, select Start with data.

  2. Select Create with Excel or .CSV file.

  3. Select the Select from device option. Go to the location where you saved the RealEstateProperties.xlsx Excel file and then upload it. (The maximum file size limit is 5 GB.)

    Copilot in Power Apps generates a table that's based on the data from the RealEstateProperties.xlsx Excel file. It has also defined seven columns of data.

  4. Next to the table name, select the pencil icon Edit table properties button.

  5. Change the table properties to the following:

    • Display name: Real Estate Property
    • Plural name: Real Estate Properties
    • Description: This table contains a listing of properties for sale.
    • Primary column: Address

    Expand the Advanced settings section and change the schema name to realestateproperty.

  6. Select Save.

  7. Select the Create app button in the lower-right corner of the screen.

    Screenshot of the imported Real Estate Property table showing seven columns and the Create app button highlighted.

  8. When the app first loads, a dialog might appear stating Welcome to Power Apps Studio. If so, select the Skip button.

    The generated app should display in Edit mode.

    Screenshot of the generated app in Power Apps Studio.

  9. Select the Data icon from the left navigation bar. A Dataverse table is created based on the RealEstateProperties.xlsx Excel file.

    Screenshot of the Data icon on the left navigation bar.

  10. Select the Tree view icon to return to the Tree view.

    Screenshot of the Tree view icon on the left navigation bar.

  11. On the app's main screen, select the gallery that's displaying the Real Estate Properties details and then select RecordsGallery1 in the Tree view to expand it.

    Screenshot of the gallery displaying the Real Estate Property details.

  12. Select the ellipsis (...) next to the NextArrow option and then delete it.

    Screenshot showing the delete Next Arrow action.

  13. Select RecordsGallery1 and then select the edit button to put the gallery in edit mode.

    Screenshot showing the action of placing the gallery in edit mode.

  14. Reduce the width and move the position of the Title component so that it's toward the right side of the template cell.

    Screenshot showing the action of adjusting the size and position of the Title component.

    Other components should reposition alongside the Title component. If not, move them until they resemble the preceding screenshot.

  15. Make sure that the gallery is still in edit mode. Select the Title.

  16. Verify that the Text value of the Title component is set to the following formula:

    ThisItem.Address

    Screenshot of the text property in the formula bar.

  17. Select the Subtitle component in the gallery.

  18. Set the Text value of the Subtitle to the following formula:

    ThisItem.Size

  19. Using the tool bar in the upper part of the page, change the Size to 13.

    Screenshot of the size being set to 13 in the toolbar.

  20. Select the Body component in the gallery.

  21. Set the Text value of the Body to the following formula:

    ThisItem.Price

    Your gallery should now resemble the following screenshot.

    Screenshot of the Real Estate Properties gallery correctly formatted.

  22. With the first item in RecordsGallery1 selected, select Insert, search for Image, and then select the Image component. This will add an image to the gallery.

  23. The image should show up in all cells of the gallery. Reposition and resize the image so that it's in the center of each gallery cell.

    Screenshot of the centered image in the gallery.

Use Copilot to generate Power Fx formulas

  1. To generate Power Fx formulas with Copilot in Power Apps, make sure that the gallery is still in edit mode. Select the gallery body that contains the price. Select Copilot and then select Text formatting.

    Screenshot of the gallery with the price component selected.

  2. Enter the following value for Desired format and press enter from your keyboard.

    $350,000

  3. Select the generated formula and then select Apply.

    Note

    With Copilot's help, the example ($350,000) value that you entered generated the following formula, which now shows in the formula bar for the price gallery control:

    (Text(ThisItem.Price, "$#,##0", "en-US"))

  4. Complete the same steps for the Size control in the gallery subtitle. Make sure that the gallery is in edit mode. Select the subtitle that contains the size. Select Copilot and then select Text formatting.

  5. Enter the following value for Desired format:

    Size: 1,800 sq ft

    Press the Enter key on your keyboard.

    You might notice that the suggestions section is empty. The cause might be a lack of information or context that's required for generating a formula.

    Screenshot of an empty formula.

  6. Because the ideas section is empty, you'll add more examples. Select + Add examples at least two more times.

    Screenshot of the Add examples button inside Power Apps Ideas.

  7. Select two current formats and then provide two corresponding desired formats.

    Screenshot of Current format options matching the Desired format options.

  8. With the added context, Copilot AI generates a suitable formula for you, as shown in the following image.

    Screenshot of the Power Apps Ideas generated formula.

  9. Select the generated formula and then select Apply.

    Your gallery should resemble the following image.

    Screenshot of the formatted gallery.

  10. Save the app.

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

    Screenshot of the Back button to exit the app.