cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AkshayManke
Responsive Resident
Responsive Resident

Enforcing Values with Combination of Specific Charaters and Numbers

Hello,

 

I am working on a solution where user should enter his/her PAN Number. (PAN is Permanent Account Number issued by Income Tax Department in India). The PAN is consisting of 10 digit alphanumeric number out of which first 5 are characters then 4 numbers and then again 1 character (Example: ABCDE1234Z). 

 

I want to have a validation/restriction that, the user must enter the PAN in the given format only - first 5 are characters then 4 numbers and then again 1 character. If any other combination (ABCDEFG123 or 1111111111) he/she enters then it should not allow to be submitted. 

 

How can we achieve this?

 

Regards,

Akshay

2 ACCEPTED SOLUTIONS

Accepted Solutions
jlindstrom
Super User
Super User
timl
Super User III
Super User III

Hi Akshay

As @jlindstrom correctly says, IsMatch is the way to do this.

The following expression will return true for a matching PAN number.

IsMatch("ABCDE1234Z", 
        "[A-Z]{5}[0-9]{4}[A-Z]{1}"
)

If you're using a form, you can add the following to your submit button.

 

If(IsMatch(txtPanNumber.Text, 
        "[A-Z]{5}[0-9]{4}[A-Z]{1}"
        ),
   SubmitForm(FormName),
   Notify("Invalid PAN Number"),
)

 

 

 

View solution in original post

5 REPLIES 5
jlindstrom
Super User
Super User
timl
Super User III
Super User III

Hi Akshay

As @jlindstrom correctly says, IsMatch is the way to do this.

The following expression will return true for a matching PAN number.

IsMatch("ABCDE1234Z", 
        "[A-Z]{5}[0-9]{4}[A-Z]{1}"
)

If you're using a form, you can add the following to your submit button.

 

If(IsMatch(txtPanNumber.Text, 
        "[A-Z]{5}[0-9]{4}[A-Z]{1}"
        ),
   SubmitForm(FormName),
   Notify("Invalid PAN Number"),
)

 

 

 

View solution in original post

AkshayManke
Responsive Resident
Responsive Resident

Hi @timl@jlindstrom ,

I tried the suggested solutions by both of you (using IsMatch) and it is working exactly as expected. Many thanks for your help on the same. Accepting both's reply as solutions. 😊

Regards,,

glad it worked for you. There’s a lot of cool

stuff you can do with that

Indeed. Will try using different combinations with this. Thanks.!!!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (14,253)