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

Restrict the users to enter specific range of numbers

Hi Team, 

 

Need your help to restrict the users to enter values between 1900 to 2050. Please help me on this(Formula) .

 

Thanks in advance .

 

Regards,

Mahesh

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Restrict the users to enter specific range of numbers

Hi @Anonymous,

Do you want to restrict the users to only enter values between 1900 to 2050 within Text Input control?

Currently, Validate functionality is not supported within Text Input control, so if you want to restrict the users to enter values between 1900 to 2050 within Text Input control directly, I afraid that there is no way to achieve your needs.

As an alternative solution, please take a try with the following workaround:

Set the OnChange property of the Text Input control (TextInput1) to following:

If(
Value(TextInput1.Text)<1900 || Value(TextInput1.Text)>2050,
UpdateContext({ShowErrorMsg:true});Reset(TextInput1),
UpdateContext({ShowErrorMsg:false})
)

Set the Text property of a Label control to following:

"Your must type values between 1900 and 2050."

Set the Visible property of the Label control to following:

ShowErrorMsg

The GIF screenshot as below:Test1.gif

 

In addition, you could also consider take a try to set the OnChange property of the Text Input control to following:

If(
Value(TextInput1.Text)<1900 || Value(TextInput1.Text)>2050,
Notify("You must type values between 1900 and 2050.",NotificationType.Error);Reset(TextInput1)
)

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
OneThing
Level 8

Re: Restrict the users to enter specific range of numbers

Hi Mahesh,

 

There is no custom Validation of Text inputs in powerapps at the moment unfortunatly.

 

You can set the input to only accept numbers as a first step.

Beyond that you can do a check within your submit button before you are allowed to Submit. I.E. Set the Display type to 

If(Value(TextInput1.text) < 1900 || Value(TextInput1.text) >2050,Disabled,Edit)

Acompany this with a Label, visible with the same Criteria as above, which says (Please Enter a year beweeen 1900 and 2050, for example) should be ok as a work around.

 

Thanks,
Nicky

Community Support Team
Community Support Team

Re: Restrict the users to enter specific range of numbers

Hi @Anonymous,

Do you want to restrict the users to only enter values between 1900 to 2050 within Text Input control?

Currently, Validate functionality is not supported within Text Input control, so if you want to restrict the users to enter values between 1900 to 2050 within Text Input control directly, I afraid that there is no way to achieve your needs.

As an alternative solution, please take a try with the following workaround:

Set the OnChange property of the Text Input control (TextInput1) to following:

If(
Value(TextInput1.Text)<1900 || Value(TextInput1.Text)>2050,
UpdateContext({ShowErrorMsg:true});Reset(TextInput1),
UpdateContext({ShowErrorMsg:false})
)

Set the Text property of a Label control to following:

"Your must type values between 1900 and 2050."

Set the Visible property of the Label control to following:

ShowErrorMsg

The GIF screenshot as below:Test1.gif

 

In addition, you could also consider take a try to set the OnChange property of the Text Input control to following:

If(
Value(TextInput1.Text)<1900 || Value(TextInput1.Text)>2050,
Notify("You must type values between 1900 and 2050.",NotificationType.Error);Reset(TextInput1)
)

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,204)