cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

IsMatch for Number Validation

Hello,

 

I have what I think is a simple question. I have two SharePoint datacards in my PowerApp one of them will be pre-populated for the user and the other they will have to enter manually. I want to be able to have the user enter a number and if it does not match the pre-populated number I would like a message to pop up saying wrong number has been entered please find/use different number.

 

I am currently using an If statement with IsMatch inside of it. I can get it to work for the number of digits I have but am unable to get it to work with matching exactly the same number.

 

Here is my code:

 If(IsMatch(DataCardValue22.Text,"^\d{8}$",DataCardValue25.Text),false,true)

 

Seems simple but still a novice.

 

Thanks for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

Re: IsMatch for Number Validation

what if you try:

If(Value(Trim(TrailerScheduled.Text)) = Value(Trim(TrailerActual.Text)), false, true)

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: IsMatch for Number Validation

@rkeeran76 
Can you please give an example?  Screenshots are great.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Frequent Visitor

Re: IsMatch for Number Validation

@mdevaney ,

 

Sorry I hope this helps.

 

This first picture is of a pop up that comes up when the number under the Trailer Actual is different than the Trailer Schedule. This is exactly what I want, but the problem lies when I put the exact number of digits but the number is different the pop up goes away. This is not what I want I want the numbers to match exactly and if they don't I want the pop up to show.

 

Good Pop Up:

Good Pop Up.JPG

 

Bad Pop Up:

Bad Pop Up.JPG

How does this help?

Highlighted
Frequent Visitor

Re: IsMatch for Number Validation

Sounds like I am not explaining well. I have a power app form that will have a number entered in the form when the user picks up the app and I want to make sure that the user of the app is using that same number so when they type in the number they are using I want to be able to give a message that the number does not match the pre-populated number and if the number is a match I don't want a message to show. I know that the If statement is needed but the IsMatch/Match function doesn't seem to recognize when the users entry is exactly the same as the pre-populated number.

 

Any help would be appreciated.

 

Thanks!

Highlighted
Responsive Resident
Responsive Resident

Re: IsMatch for Number Validation

what if you try:

If(Value(Trim(TrailerScheduled.Text)) = Value(Trim(TrailerActual.Text)), false, true)

View solution in original post

Highlighted
Frequent Visitor

Re: IsMatch for Number Validation

@Alex_10 

 

That worked perfectly. Thank you so much for your help!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,585)