web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I flag a requir...
Power Apps
Unanswered

How do I flag a required text field in a form, and display and error message, if the data that is entered is not an integer that is 5-7 digits long?

(0) ShareShare
ReportReport
Posted on by 831 Moderator

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? 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    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

  • futr_vision Profile Picture
    831 Moderator on at

    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?

  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    @futr_vision ,

    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

  • futr_vision Profile Picture
    831 Moderator on at

    Adding to the OnChange doesn't actually do anything for me. No errors either. How would I troubleshoot this?

  • WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    @futr_vision ,

    Please see revised code

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard