cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Change Default Value of Text Input via OnSelect command

Hello, 

 

I need help building an 'OnSelect' command that changes the default value of a 'Text Input' field in my app.

 

Here is more background.  I have a 'Text Input' field (numberic) with a default value of "0" and maximum character lenght of 2.  See attachment.

 

Users are complaining that when trying to enter a new value,  the "0" default value apears in the screen and it requires to do a backspace before being able to enter the new value.  This is making it unfriendly for user to enter values.  

 

Is there an OnSelect command that I can add to the Text Input field that would change the default value to blank or ("") ? ???

 

Help!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi!

 

Just like this

 

dariobois_0-1603902233504.png

 

Then, use this formula when you want to put a value into textbox. In OnVisible property of that screen, for example.

 

UpdateContext ({varDefault: 123123123}) 

 

Replace "123123123" with a value you want or, take it from another textbox for example.

 

Regards!

 

View solution in original post

3 REPLIES 3
Resolver II
Resolver II

Hi!

 

You can put a Context Variable on the Default property of the TexBox, then change its value from OnSelect property of another control.

 

Regards!

Hi Dariobois,

 

Thanks for your prompt response.  I like your suggestion.  But how don't know how to set the variable to the number 0.  I am only familiar with setting variables to true or false.

 

You mind taking a look at the sentence in the screen shot to see what I am doing wrong? (varDefault0 = Number:0) 

 

Hi!

 

Just like this

 

dariobois_0-1603902233504.png

 

Then, use this formula when you want to put a value into textbox. In OnVisible property of that screen, for example.

 

UpdateContext ({varDefault: 123123123}) 

 

Replace "123123123" with a value you want or, take it from another textbox for example.

 

Regards!

 

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (10,530)