cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate IV
Advocate IV

IsMatch Optional Digits Single Digit Only

I am trying to use the IsMatch to verify a TextInput of Time. Currently it is

IsMatch( TextInput1_1.Text, OptionalDigits & Digit & ":" & Digit & Digit)

. This is so the user can type in 5:00 and it would work. The problem is that the user can also type in 125:00 or 213455135:00.

Is there a way to just allow a single optional digit?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: IsMatch Optional Digits Single Digit Only

Could you combine this with the LEFT or RIGHT function and only return a single value to the left of the : sign?

 

https://powerapps.microsoft.com/en-us/tutorials/function-left-mid-right/

 

edit: I ment left/right, sorry

View solution in original post

4 REPLIES 4
Highlighted
Memorable Member
Memorable Member

Re: IsMatch Optional Digits Single Digit Only

Could you combine this with the LEFT or RIGHT function and only return a single value to the left of the : sign?

 

https://powerapps.microsoft.com/en-us/tutorials/function-left-mid-right/

 

edit: I ment left/right, sorry

View solution in original post

Highlighted
Advocate IV
Advocate IV

Re: IsMatch Optional Digits Single Digit Only

Thanks, that worked. I then discovered though I could just set the maxlength of the text input to 5 so the user can't even type in more than that.

Highlighted
Anonymous
Not applicable

Re: IsMatch Optional Digits Single Digit Only

That is what I wanted to suggest. Smiley Happy

Highlighted
Memorable Member
Memorable Member

Re: IsMatch Optional Digits Single Digit Only


@Alerts_OM_USA wrote:

Thanks, that worked. I then discovered though I could just set the maxlength of the text input to 5 so the user can't even type in more than that.


 

I didn't know you could do that, great find!

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,233)