cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Dialog box, triggered by textInput

Hi everyone,

I am currently creating a dialog box as a reminder "Please do secondary check"

Dialog box variable name is: REMINDER_PopUp

What triggers the dialog box to pop up is a TextInput.text : "ABC" or "CTO"

 

In my dialog box's visibility my string is: 

With({wText:Upper(TextInput.Text)}, wText ="ABC"|| wText="CTO")

 

Now to close the dialog box, I have an OK Button:

In my OK Button's OnSelect : UpdateContext({ShowReminder:false}) -----> this does not work

                             also tried:  REMINDER_PopUp.Visible = false -----------> does not work

 

 

What do you think will work best?

 

 

Appreciate your help.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

None that I know of.  You would have to have some action that fires when you enter text into the TextInput and there isn't any.  OnChange only fires when you exit the textbox.  You could try setting up a timer that is constantly checking the value of the textbox.  But I suspect that would be a performance drain that you don't want.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

11 REPLIES 11
Pstork1
Dual Super User
Dual Super User

Don't set the visibility directly using your With() statement.  Instead use that in an IF in the OnChange property of the textinput to set the ShowReminder context variable to true.  Then update the context variable in the ONSelect of the OK button as you already tried.  Its not the OK button you need to change.  Its the dialog Box's basic visibilty.

Textinput OnChange property
If(With({wText:Upper(TextInput.Text)}, wText ="ABC"|| wText="CTO"),UpdateContext({ShowReminder:true}), UpdateContext({ShowReminder:false}) )


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Anonymous
Not applicable

Thank you @Pstork1 

I tried adding the suggested string in the TextInput's Onchange property:

OnChange_TextInput.JPG

 and the OK Button's Onselect to: 

button_Onselect.JPG

 it doesn't seem to work.

 

The dialog box remains visible whatever text  I use in the TextInput.

And clicking the OK Button does not close the dialog box.

 

Should I not set anything in the dialog box's visibility?

 

 

 

YOu also need to change the Visible property of the Dialog box itself to ShowReminder.  That's what makes it all work.  Otherwise you With() statement in the Visible property will override everything else.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Anonymous
Not applicable

Hi @Pstork1 

Adding ShowReminder in the dialog box's visible property actually makes the OK Button work!

However, for whatever reason...when I type "ABC" or "CTO" or any other text in the TextInput, the dialog box did not PopUp 😞

 

Is your dialog box implemented as a separate screen or just a dialog on the same screen as the text input?  If its a separate screen then you'll need to use a global variable instead of a context variable.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Anonymous
Not applicable

Hi, this is dialog box on the same screen as the text input.

If the code to set the Context to True is in the OnChange property of TextInput control be ware that it won't actually fire until you leave the Textinput control.  I tested it and this does work., but you have to move the cursor out of the textinput to commit the change before it will show the dialog.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Anonymous
Not applicable

Aaahhh, yes. I tried, it did work! 

However, is there a way to make the dialog box popUp by just entering "ABC"or "COT", even if the cursor is still in the TextInput?

None that I know of.  You would have to have some action that fires when you enter text into the TextInput and there isn't any.  OnChange only fires when you exit the textbox.  You could try setting up a timer that is constantly checking the value of the textbox.  But I suspect that would be a performance drain that you don't want.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,807)