cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Power Automate
Power Automate

MessageBox

Good morning:

 

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

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps
Power Apps

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.

View solution in original post

4 REPLIES 4
Power Apps
Power Apps

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.

View solution in original post

I will give that a try! Thank you!

Power Apps
Power Apps

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

Radu Gruian [MSFT] ** PowerApps Staff
Helper IV
Helper IV

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.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,295)