web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to make Pop-Up dia...
Power Apps
Answered

How to make Pop-Up dialog close

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I want my dialog to popup when the amount requester insert is more than 250, therefore I set my visible property of PopUp dialog to:
If(Value(DisAmountUSD.Text) > 250,true,false)

 

But I also want the requester able to close the dialog by clicking on the close button, since i set my visible property to If(Value(DisAmountUSD.Text) > 250,true,false) instead of variable, I am not sure what can I put in the onselect property of close button to make it close.

Appreciate if anyone can suggest any solution to me, thanks in advance.

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Anonymous ,

     

    The defined condition won't satisfy the need.

    Instead add condition as follows:

    If(Value(DisAmountUSD.Text) > 250 && varPopUp,true,false)

     

    Then add a "X" icon or close button and set the following:

    UpdateContext({varPopUp: false});

     

    Note: When you are want to meet the condition for amount, you need to set the variable true so it shows the pop-up.

    You can set the pop-up variable to true by setting "Visible" property for your screen.

     

    Hope this helps

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    Hi,

    You're on the right track with your If condition, but you'll indeed need to use a variable to control the visibility of the dialog based on both the condition and the close button. Here's how you can do it:

     

    Create a variable:
    On the OnStart property of your app, initialize a variable (like varShowDialog) and set it to false. This variable will be used to control the visibility of the dialog box.

     

    Set(varShowDialog, false)

     

    Check the Amount:
    On the OnChange property of your DisAmountUSD text input control, you can check whether the entered value is more than 250. If it is, set varShowDialog to true.

     

    If(Value(DisAmountUSD.Text) > 250, Set(varShowDialog, true))


    Set Visibility of Dialog:
    Now, you can set the Visible property of your dialog to varShowDialog. This will make the dialog box appear when varShowDialog is true.

     

    Close the Dialog:
    On the OnSelect property of your close button, set varShowDialog to false. This will hide the dialog box when the close button is clicked.

     

    Set(varShowDialog, false)

     

    So in summary, whenever a value is entered into DisAmountUSD, the condition will check if it's greater than 250. If it is, varShowDialog is set to true and the dialog box appears. When the close button is clicked, varShowDialog is set to false and the dialog box disappears.

     

    Hope this helps! Let me know if you have any other questions.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @AJ_Z , 

     

    Unfortunately, the solution doesn't work for me, there is no error in the formula but the dialog doesn't popup when the amount is more than 250.

    I'm not sure whether this will affect the result or not, but my DisAmountUSD is in DisplayMode.View, it calculate the Amount*USDperCurrency and if the calculated amount more than 250, I wish to have a pop-up dialog. 

    weeny99_0-1688464067282.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Ethan_R ,

     

    I'm not sure why but the dialog doesnt show up when the amount exceeded 250. Is there other way to do it?

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Anonymous ,

     

    If you are using @AJ_Z  method then here's the steps you should follow:

     

    Step 1: OnChange of the TextBox of the DataCardValue: (Note: Not entire Card)

    If(
     Value(Self.Text) > 250, 
     Set(varPopUp, true)
    )

     

     Step 2: Set the PopUp control/container/group whatever you have used. in the Visible property.

    varPopUp

     

    Step 3: Make sure you have a close button in the container within Pop-Up container so you can close this:

    Button or Icon for closing -> OnSelect property

    Set(varPopUp, false);

     

    This is the most ideal scenario in your case. 

    Let me know if you face any issue.

     

    Hope this helps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Ethan_R ,

     

    The formula works for my amount text field, but not for my AmountUSD, I think it is because I change the default of DisAmountUSD to calculated field, the Onchange property is not working.

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Yes @Anonymous ,

     

    OnChange will work only if edit is made on it.

    If its default value then you can try the following:

    Default property

    If(
     //calculation > 250,
     Set(varPopUp, true)
    )

    Replace ur calculation part and check

     

    Hope this helps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Ethan_R ,

     

    Thanks for the reply. However, there is error on the formula.

    PopUp Error.png

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Anonymous ,

    Oh, we cannot add Set in Default.

    But if the value is static and cannot be changed. 

    We need to find another way, either during submit button or Screen 'Visible' property which will capture the datacardvalue and set true.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Ethan_R ,

     

    Sorry for the late reply, I’ve make the pop up appear during submission. 

    Thank you so much for your help!

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard