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.
Thanks, this works well and have managed to get this integrated into the published form. Thanks to you and everyone else who made suggestions!
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))
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)
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.
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)
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})
clicking A results in
and clicking the red label makes it go away
WarrenBelz
146,771
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional