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

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
JRaasumaa
Level 10

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

4 REPLIES 4
JRaasumaa
Level 10

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

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.

Anonymous
Not applicable

Re: IsMatch Optional Digits Single Digit Only

That is what I wanted to suggest. Smiley Happy

JRaasumaa
Level 10

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 287 members 2,903 guests
Please welcome our newest community members: