I have a form with a required text field. It throws an error if you try to submit the form but there is no value in it. That's fine but I want to prevent a user from submitting the form if the text field does not contain a 5-7 digit integer much like you prevent the form from being submitted if the field was blank. At the same time, I want to show an error message if the field does not contain a 5-7 digit. How can I do this?
Please see revised code
Adding to the OnChange doesn't actually do anything for me. No errors either. How would I troubleshoot this?
There would be several options - example OnChange of the Text Box
If(
Value(Self.Text) < 10000 || Value(Self.Text) > 9999999
Reset(Self);
Notify("Must contain . . . . .")
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Where would I be using this formula and how would I trigger the error or does that happen natively if the condition is not met?
Hi @futr_vision ,
You could use the test
Value(YourTextInput.Text) > 9999 && Value(YourTextInput.Text) < 10000000
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional