Hi,
I want to validate "123801902V" or "201923920v" text filed in a form in the power app .How I do it?
there should be 9 digits and one letter .
Thank you.
Hi @enriqueglopez , If i use "0 " also into pattern. Can be this one?
"^\d[0-9][vV]$"
Your validation is incorrect if you want to have only 6 digits (numbers).
With your code, only the length of the input value will be evaluated, regardless of whether it is a number or text.
I recommend you to use RegEx again. Its a better practice.
Modify the previous RegEx from
"^\d{9}[vV]$"
to
"^\d{6}$"
But, if you want to validate 6 characters length, numbers or text, you can use your code or this RegEx.
"^[a-zA-Z0-9]{6}$"
RegEx its really useful for validation.
Hi guys,
then if i want to validate 6 digits long ID.can I use like this?
@Erandi If last letter will always "V" or "v", this should also help you
IsMatch(
TextInput1.Text,
Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Letter
) && ("V" in TextInput1.Text || "v" in TextInput1.Text)
You can add above thing in the condition.
-----------------------------------------------------------------------------------------------------------------------------
I hope this helps.
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.👍
Thanks,
ANB
Use this one instead
"^\d{9}[vV]$"
This Regex will validate that the first 9 characters are a number and the last is V or v.
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hi guys,
If I use the numbers between 0 to 9, it should be
@Erandi Try this
IsMatch(
TextInput1.Text,
Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Digit & Match.Letter
)
-----------------------------------------------------------------------------------------------------------------------------
I hope this helps.
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.👍
Thanks,
ANB
Hi @mmbr1606 ,yes it can be "V" and "v". That is a ID number pattern. So i want validate it when submitting to form.
You can use IsMatch function to compare your input value with a RegEx.
For example:
IsMatch(TextInput.Text, "^\d{9}[a-zA-Z]$")
This Regex will help to reach what you want. You could do the validation like this:
If(
IsMatch(
TextInput.Text,
"^\d{9}[a-zA-Z]$"
),
"Input is valid",
"Input is not valid"
)
Ref: IsMatch, Match, and MatchAll functions - Power Platform | Microsoft Learn
If this post helps, then please consider Accept it as the solution to help the other members find it.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2