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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

MessageBox

(2) ShareShare
ReportReport
Posted on by 987

Good morning:

 

Is there a way to pop up a message box asking for input (for a variable)?

 

Thank you.

Categories:
I have the same question (0)
  • Verified answer
    CarlosFigueira Profile Picture
    on at

    Not really - the ability to show pop ups to the user (both to just present text and to request input) isn't part of the platform. Please create a new entry in the PowerApps Ideas Board if you feel that this feature is important.

     

    You can, however, simulate a pop-up by "drawing" your pop-up on top of the screen (i.e., a Rectangle shape, a text box to indicate the caption, a text input for the user to enter the value, and a button to confirm the data entry), and set the Visible of those controls to a variable (variables default to false). When you want to show the dialog, you would set that variable to true. Notice that this wouldn't be a modal dialog, so you would need to make the dialog cover the whole screen to prevent the user from interacting with other controls while the dialog is showing.

     

    Here's a more detailed example of how this can be accomplish. For simplicity sake, I'm drawing the dialog not on top of the "trigger" button:

    DialogBox1.png

     

    And setting the following properties:

     

    Button1.Text: "Click to open input box"
    Button1.OnSelect: UpdateContext({variableDefault:" "});UpdateContext({showDialog:true,variableDefault:""})
    TextBox1.Text: "Value entered: " & variable
    Rectangle1.Visible: showDialog
    TextBox2.Visible: showDialog
    TextBox2.Text: "Enter the value:"
    TextInput1.Visible: showDialog
    TextInput1.Default: variableDefault
    ButtonOK.Visible: showDialog
    ButtonOK.OnSelect: UpdateContext({showDialog:false,variable:TextInput1.Text})
    ButtonCancel.Visible: showDialog
    ButtonCancel.OnSelect: UpdateContext({showDialog:false})

    When clicking the first button, it changes the value of the 'variableDefault' variable to clear the value in the text input from the dialog, and then setting the 'showDialog' to true. When the cancel button is pressed, it only hides the dialog, but when the OK button is pressed, then it also updates the variable value with the text from the input.

  • audrieFCT Profile Picture
    987 on at

    I will give that a try! Thank you!

  • rgruian Profile Picture
    on at

    We have added this idea/request to our backlog, and we will try to address it in the upcoming releases. Thanks!

  • Community Power Platform Member Profile Picture
    on at

    Crude but it works.  I have set the DisplayMode to Disabled for my controls when the 'dialog box' is visible:

     

    If(showDialog = false,DisplayMode.Edit,DisplayMode.Disabled)

     

    I also had to Update the context variable when the screen On Visible event occurs as my controls were remaining disabled otherwise:

     

    UpdateContext({variableDefault:" "});UpdateContext({showDialog:false,variableDefault:" "})

     

    It's hard to believe basic functionality like Dialog / Message / Input boxes were not included as 'out of the box' features.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard