Announcements
Hi Hive Mind,
I want to add a validation to a TextInput that disables a submit button if TextInput.Text is not in the range of P00001-P99999.
It's probably obvious, but its got me stumped on this Friday morning.
Thanks in advance 👍
Here you go:
If(IsMatch(TextInput1, "^P([0-9]{5})$"), "Matches", "Does not match")
Edit: I've just realised this will also match P00000. If that's an issue, we can correct it.
Edit 2: Here you go:
If(IsMatch(TextInput1, "^P(?!0{5})[0-9]{5}$"), "Matches", "Does not match")
Thanks for the quick reply @charlessexton. Excuse my ignorance, where do I need to apply this?
Ah, sorry. Put this in the DisplayMode property of your submit button:
If(IsMatch(YOURINPUTCONTROL, "^P(?!0{5})[0-9]{5}$"), DisplayMode.Edit, DisplayMode.Disabled)
@charlessexton that's awesome, thank you.
I do now have an extension question. Can I wrap that in an Or function to achieve validation for the same range of 'H' numbers?
You could do that, or it can be included in the regular expression in the IsMatch() function, like so:
If(IsMatch(YOURINPUTCONTROL.Text, "^[P|H](?!0{5})[0-9]{5}$"), DisplayMode.Edit, DisplayMode.Disabled)
@charlessexton you've made my Friday awesome. Have a great weekend, and Thank you.
Thanks @SieraQuebecLima . It makes me happy to hear that! Have a great weekend, too. You're very welcome.
Revisiting this with the aim of offering use of a barcodereader to fill the same textinput. I'd like a scanned input to enable the button also. can this be done?
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 396 Most Valuable Professional
11manish 134 Super User 2026 Season 2
MS.Ragavendar 101 Super User 2026 Season 2