Tuesday 24 March 2020

PowerApps - Design Popup/Dialog to display Error/Warning Message


One of the most common requirement in any application/project is to Show Error/Warning Messages.

Currently In PowerApps, there is no direct way to show popup/dialog box in order to show any information/warning/error message to end users.

Today, as part of "PowerGuide Mentorship Program", I am going to give you PowerGuide - Tip3 where we'll learn, how to design Popup/Dialog Box in Canvas Apps

Let's get started...

Step 1: Create a Blank Canvas App > Connect with Dynamics 365 Data Source > Connect with Lead Entity

Step 2: Add few Text Inputs and Button Control to design the Screen for Lead Creation


Step 3: Add few Controls like Labels and Icons in order to design Popup/Dialog Box.



Step 4: Declare Variable and Manage the Hide/Show of Popup/Dialog

Let's understand the Logic to Show/Hide Popup/Dialog in 3 Steps:

  1. Set Popup/Dialog Visibility to FALSE On Load of Screen.
  2. OnClick of Submit Button, Check if lead of entered emailaddress already exist in D365, if Yes, then Set Popup/Dialog Visibility to TRUE else FALSE.
  3. OnClick of Close icon (X) inside dialog box, Set Popup/Dialog Visibility to FALSE.
Note : Here Popup/Dialog is the Collection of various Controls that we are using to design the Popup/Dialog. That means, hiding the Popup/Dialog means you'll have to set all the controls Visibility to FALSE that has been used to design the Popup/Dialog and Showing the Popup/Dialog means you'll have to set the same controls Visibility to TRUE.

Keep all the Popup/Dialog Box Controls Visibility to False on Load of Screen

If Lead of same emailaddress already exist, then Set Popup/Dialog Box Visibility to True else False

Set Variable to Popup/Dialog Box Control's Visible Property. In above screen, I have set Variable to only errorMsg label (as shown in highlighted screen). However, you have to do the same for all the Controls that you are using to design the Popup/Dialog Box


Step 5: Set Visibility of Popup/Dialog Box Controls on Button Click.

Hide All Popup/Dialog Box's Controls on (onSelect) property of Close Icon

Step 6 - Run the App





Hope this Tip helps someone to incorporate various requirements.

Stay Tuned for my next Tip - PowerGuide - Tip4 as part of  PowerGuide Mentorship Program Series

Cheers 👍

3 comments:

  1. It is truly a great and useful piece of information. how can i subscribe for a blog site? It is truly a great and useful piece of information.thanks for sharing these information
    c language interview questions

    ReplyDelete
  2. Digital Signage Supplier, 22 inch plug and play auto loop video screens for POS/POP promotion

    Commercial Display Manufacturer Co Ltd is the specialist Digital signage supplier, providing heavy-duty 22" plug and play auto loop video screens for POS/POP promotion.

    Visit here:- POP Video Screen

    ReplyDelete
  3. Digital Signage Supplier, 22 inch plug and play auto loop video screens for POS/POP promotion

    Commercial Display Manufacturer Co Ltd is the specialist Digital signage supplier, providing heavy-duty 22" plug and play auto loop video screens for POS/POP promotion.

    Visit here:- POP Video Screen

    ReplyDelete

Blogger Widgets