Skip to main content

Notifications

Community site session details

Community site session details

Session Id : TVPu/MrIFgJ3PeOYjExvCd
Power Apps - Building Power Apps
Answered

Setting up a popup warning then clearing once read

Like (0) ShareShare
ReportReport
Posted on 10 Feb 2023 17:04:05 by 8

Sorry, Newbie here.

 

I am creating an App using dropdown selection e.g. options A,B,C,D.   If a user selects A (and none of the others) I want to have a message popup to tell them they have to complete a specific text box with justification.  

I can get the popup to appear by setting the Visible property as:

DataCardValue1.Selected.Value="A"

so the user sees the message.

But I can't see how to add in an action so the user can confirm reading and close the popup, such as by clicking a cancel icon. The selected value A would remain so I guess the popup's Visible property will remain true.  Please can someone advise what I'm missing?  Thanks in advance.

  • markl42 Profile Picture
    8 on 13 Feb 2023 at 15:48:53
    Re: Setting up a popup warning then clearing once read

    Thanks, this works well and have managed to get this integrated into the published form.   Thanks to you and everyone else who made suggestions!

  • Shavar_Scott Profile Picture
    175 on 10 Feb 2023 at 18:53:15
    Re: Setting up a popup warning then clearing once read

    @markl42 

     

    Option 1: 

    Powerapps has out of the box functionality for a popup quick notification on top of the page; which disappears automatically. If you are interested, this would be the easiest way to go. Insert the below code on the OnChange property of the DropDown:

     

     

    //Notification Pop Up on when OPtion "A" is selected from Dropdown
    //OnChange property:
    
    If(Dropdown1.SelectedText.Value = "A", Notify("Please complete a specific text box with justication",NotificationType.Warning))

     

     

    Shavar_Scott_0-1676054008826.png

     

    Dopdown1 - is the name of the control in my app. You will probably need to replace is with DataCardValue1.Selected.Value

     

    Option 2:

    If you want to have a physically screen (object) that blurs everything out and forces your users to read your pop up. You can use this method. 

     

    In the OnChange Property of your dropdown, set a variable to "true" which will control the visibility of the your popup:

     

     

    Set(varIsVisiblePopUp, true)

     

     

    Set the Visible property of your Pop Up to this variable

     

    //Visible property of Pop Up
    
    varIsVisiblePopUp

     

     

    If your popup has a cancel(close) button or icon, use the OnSelect property to toggle the varIsVisiblePopUp variable to false. This will then hide your popup.

     

     

    //OnSelect property of Cancel/Close button or icon
    Set(varIsVisiblePopUp, false)

     

    Shavar_Scott_2-1676055173301.png

     

     

    Lastly, you will always want to hide the pop up when the user first visits the screen; so for good measure, I would default the varIsVisiblePopUp to false when the screen becomes visible. To do this, go to the OnVisible property of the screen and set varIsVisiblePopUp to false. 

     

     

    //OnVisible property of Screen
    
    Set(varIsVisiblePopUp, false)

     

     

    Either option should work. Good luck.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on 10 Feb 2023 at 18:41:34
    Re: Setting up a popup warning then clearing once read

    You may want to use a variable, and use a container for your popup.  You can add multiple components to the container (your warning, an icon, even your text box). Set the visible property to 

    DataCardValue1.Selected.Value="A" And varA

     

    That way you can hide it by toggling your variable to false.  This can be done via your icon in the container.

     

    App OnStart:

    Set(varA, true)

     

    "Cancel" icon

    Set(varA,false)

     

    Rusk_0-1676054440165.png

     

  • Verified answer
    TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on 10 Feb 2023 at 18:35:31
    Re: Setting up a popup warning then clearing once read

    I put in a dropdown with the OnChaneg of

    If(Self.SelectedText.Value="A",UpdateContext({showDiag:true}))

     

    and items of

    ["A","B","C","D"]

     

    I then plac e albel and set its visible to showDiag

    and it's onselect to

    UpdateContext({showDiag:!showDiag})

     

     

    TheRobRush_0-1676054083184.png

    clicking A results in

    TheRobRush_1-1676054113268.png

    and clicking the red label makes it go away

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,771 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started