Exercise - Design additional pages and email in Power Apps

Completed

In this unit, you'll design some additional pages to support your mixed reality features. These pages carry out some specific functions that are required in order for the application to behave appropriately. You'll also be using the emailing functionality of Power Apps to send the order details to the customers.

Create notes page

The user can take pictures during the View in MR session and display them through a gallery. On the Notes page, you can store textual notes and images captured during View in MR session.

  1. Create two new Blank screens and rename them Product_notes and Carpet_notes.

    Screenshot of new screens for notes.

  2. Design the Product_notes page: Select the Input dropdown, and then select Text input. Rename it TextInput_products.

    Screenshot of adding Text input.

  3. Select Gallery > Horizontal to include a horizontal type of gallery. You'll be storing photos taken during the View in MR session in this gallery. Rename the gallery View_products.

    Screenshot of adding horizontal gallery.

  4. Position the gallery at the other part of the screen. Retain only the image by deleting the Subtitle and Title. Enlarge the image.

    Screenshot of only image in gallery.

  5. Select the gallery and configure the Items property by adding the following line:

    ViewInMR1.Photos
    

    Screenshot of adding property to gallery.

    All the pictures taken in the View in MR session are stored in this gallery for future reference.

  6. Let's insert a label at the top of the screen. Select the Label option and then Center align it. Customize the position, color, and text display according to your needs. Rename it Notes_label.

    Screenshot of inserting label.

  7. We'll place a Back icon over the previously added Label to help the user navigate to the Home Page when required. To add the Back icon, on the Insert tab, expand the Icons dropdown and then select the Back icon.

    Screenshot of adding back icon.

  8. Position the Back icon correctly and configure the OnSelect property by adding the following:

    Navigate(Product_details,ScreenTransition.Cover)
    

    Screenshot of positioned and OnSelect.

  9. Switch to the Product_details screen and add a Note icon from the Icons dropdown on the Insert tab.

    Screenshot of adding note icon.

  10. Configure the OnSelect property of the Note icon by adding the following line:

    Navigate(Product_notes,ScreenTransition.CoverRight)
    

    Screenshot of OnSelect for note.

  11. Replicate the same procedure for Notes_carpets.

    Note

    We won't include the View in MR feature for the Carpets category. For the Notes_carpets page, exclude adding the Gallery control to store photos taken during the View in MR session.

    Tip

    You can test your application by pressing the F5 key on the keyboard or selecting the Play button at the top-right corner of Power Apps Studio.

Create order summary page

  1. Add buttons to the Product_details and Carpet_details screens. Rename the buttons Order_product and Order_carpet. Change the display text of the buttons to Order.

    Screenshot of adding order button.

  2. Create two new Blank screens and rename them Order_products and Order_carpets.

    Screenshot of adding new screens.

  3. Select the Product_details screen and then configure the OnSelect property of the Order button as follows:

    Navigate('Order_products',ScreenTransition.Cover)
    

    Screenshot of Order OnSelect configuration.

  4. Follow the same procedure for the Carpet_details screen.

  5. In the Order_products page, insert Product, Price, Color, and Notes labels and rename them accordingly.

    Screenshot of labels in Order_sofas.

  6. Insert empty labels next to the Product, Price, Color, and Notes as shown in the figure.

    Screenshot of empty labels in Order_sofas.

  7. Configure the Text property of these empty labels as follows:

    • Product:

      Gallery_products.Selected.Name
      

      Screenshot of configuring Product text.

    • Price:

      Gallery_products.Selected.Price
      

      Screenshot of configuring Price text.

    • Color:

      Gallery_products.Selected.Color
      

      Screenshot of configuring Color text.

    • Notes:

      TextInput_products.Text
      

      Screenshot of configuring Notes text.

  8. Add another label at the top and change its display text to Order Summary. Change the font size and font according to your needs.

    Screenshot of adding Order Summary label.

  9. Expand the Gallery dropdown and select Horizontal. Retain only the image; delete other components of the Gallery. Rename it Order_gallery_products

    Screenshot of adding gallery.

  10. Configure the Items property of this gallery by adding the following line:

    ViewInMR1.Photos
    

    Screenshot of configuring items in gallery.

  11. Add three Labels and change the display text to Enter your email to get an order confirmation mail!, Organization mail ID:, and Customer mail ID:, respectively.

    Screenshot of three labels.

  12. Expand the Input dropdown and select Text input. Add two Text input components to the screen and position them as shown in the image. Rename them Input1_products and Input2_products.

    Screenshot of two text input fields.

  13. Configure the Hint text property by adding Enter mail ID:; store no value in the Default property. Adjust the font size and color according to your need.

    Screenshot of configuring hint text.

  14. Add a button from the Insert tab and configure its Text property by adding Confirm.

    Screenshot of adding confirm button.

  15. Expand the Icons dropdown and select Back and Home icon. Position them correctly, as shown in the image.

    Screenshot of adding back and home icons.

  16. Configure the OnSelect property of these two icons as follows:

    • Back:

      Navigate(Product_details,ScreenTransition.CoverRight)
      

      Screenshot of back OnSelect config.

    • Home:

      Navigate('Home Page',ScreenTransition.CoverRight)
      

      Screenshot of configuring OnSelect: Order.

  17. Follow the same procedure for Order_carpets.

Create end page

  1. Create a Blank screen and rename it End page.

    Screenshot of the end page.

  2. Add a Label and change its display text to Order Successfully Submitted!. Position the label as required on the screen.

    Screenshot of adding label for Order Successfully Placed.

  3. Add a Button at the bottom of the screen. Configure the Text property of the button by adding Shop more. Let's direct the user to the home page: select the Shop more button, then add the following line in the OnSelect property.

    Navigate('Home Page',ScreenTransition.Cover)
    

    Screenshot of show more button.

  4. Expand the Media dropdown and select Image to add an image component to the End page.

    Screenshot of adding image component.

  5. Position the image as shown in the image. Select the logo file to display.

    Screenshot of adding logo file to the image component.

    Tip

    Save your application frequently by selecting the File tab at the top and selecting the Save option. If prompted, select the The cloud option and then select Save.

Send emails via Power Apps

  1. Select the Data tab and select + Add data. Expand the Connectors, then select Office 365 Outlook to add it as one of the connectors for this application.

    Screenshot of adding data connectors for Outlook.

  2. Open Order_products and then configure the OnSelect property of the Confirm button by adding the following lines:

    Office365Outlook.SendEmailV2(Input1_products & ";"& Input2_products,"Order Summary","<b> Your order is successfully submitted! </b> <br> Order details are as follows: <ul> <li> Product: " & Order_product_name_details & "</li> <li> Price: " & Order_price_details & "</li> <li> Color: " & Order_color_details & "</li> </ul>Notes: " & TextInput_products & "<br><b> Thank you for shopping with us! </b>");
    Navigate('End page',ScreenTransition.Cover)
    

    Screenshot of configuring confirm button.

    Note

    The names used in the preceding function follow the naming conventions used in this application at the time of development. You can customize the function according to your application.

Implementing the preceding steps must make your application work in the following way: your application will include a Notes page to store all the session notes, an Order summary page to review your order and send mails, and an End page to provide an excellent closure to the application.

 Animation of application demo after adding additional pages and email functionality.

Test your application on a mobile device

  1. Choose the download link for your device:

  2. Open Power Apps on your mobile device and sign in with your Microsoft account credentials.

  3. The apps that you used recently will appear on the default screen when you sign in to Power Apps mobile.

    The Home is the default screen when you sign in. It displays the apps you used recently and the apps that you've marked as favorites.

  4. To run an app on a mobile device, select the app tile. If this is the first time you're running a canvas app by using Power Apps mobile, a screen shows the swipe gestures.

  5. To close an app, use your finger to swipe from the left edge of the app to the right. On Android devices, you can also select the Back button and confirm that you intended to close the app.

    Note

    If an app requires a connection to a data source or permission to use the device's capabilities (such as the camera or location services), you must give consent before you can use the app. Typically, you're prompted only the first time you run the app.