cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rkeeran76
Helper I
Helper I

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

what if you try:

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

View solution in original post

5 REPLIES 5
mdevaney
Super User III
Super User III

@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."

@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?

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!

what if you try:

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

View solution in original post

@Alex_10 

 

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

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (61,041)