cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
fredflo27
Level: Powered On

Mismatch regular expression

Hello
On a PowerApps form (Sharrepoint Integration) I would like to impose an input format for a text column. I dont' know how to do that. For example : E.05.F.44.B
For this example : E or S for first postion F or C for five position and to impose the numbers (not text).
i found that but i don't know to use : mismatch(datacardvalue3;"[SE]\.\d{2}\.[FC]\.\d{2}\.[A-H]").
 
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Mismatch regular expression

Hi @fredflo27 ,

Currently, I could not reproduce your issue on my side. Firstly, the formula I provided above could only be used within the Bahaviour properties of controls, you could not use it within a Text property (Non-bahaviour property) of a control.

 

I agree with your solution almost, you could set the Text property of the ErrorMessage3 Label to your IsMatch formula. In addition, you could also consider set the formula I provided above within the OnChange property of the Identifiant Text Input box, once the mouse focus is moved from your Identifiant Text Input box to other place in your app, the OnChange Event of the Identifiant Text Input box would be fired.

 

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Mismatch regular expression

@fredflo27 

In PowerApps there is no function called MISMATCH.  We only have ISMATCH, MATCH AND MATCHALL.  Suggest you try one of these instead.  https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-ismatch

Community Support Team
Community Support Team

Re: Mismatch regular expression

Hi @fredflo27 ,

Could you please share a bit more about the mismatch function?

Do you want to check if the entered data match the specific format within your custom form?

 

Currently, within PowerApps, there is no function called 'mismatch', I assume that the function you want to use is "IsMatch" function, is it true?

 

If you want to check if the entered data match the specific format within your custom form, show up a error message when the entered data does not match the specific format, please take a try with the following workaround:9.JPG

Set the OnChange property of the TextInput1 to following:

If(
!IsMatch(TextInput1.Text, "[SE]\.\d{2}\.[FC]\.\d{2}\.[A-H]"),
Notify("The entered data does not match the required format, e.g. E.05.F.44.B", NotificationType.Error);Reset(TextInput1)
)

On your side, you may need to set the OnChange property of the DataCardValue3 to following:

If(
    !IsMatch(DataCardValue3.Text, "[SE]\.\d{2}\.[FC]\.\d{2}\.[A-H]"), 
    Notify("The entered data does not match the required format, e.g. E.05.F.44.B", NotificationType.Error);Reset(DataCardValue3)
)

If the entered data in your DataCardValue3 does not match the "[SE]\.\d{2}\.[FC]\.\d{2}\.[A-H]" format, the error message would show up, and the DataCardValue3 would be reset.

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
fredflo27
Level: Powered On

Re: Mismatch regular expression

I try just to test with that and no error message but that accept the text too :

 

IsMatch(DataCardValue3.Text;"d{2}")

Community Support Team
Community Support Team

Re: Mismatch regular expression

Hi @fredflo27 ,

Based on the formula you provided, I think there is something wrong with it. There is something wrong with the regular expression within your IsMatch function.

 

Please consider modify your formula as below:

 

IsMatch(DataCardValue3.Text; "\d{2}")           /* <-- Please do not miss the '\'symbol */

 

Have you taken a try with above solution I provided? Is it helpful in your scenario? If the solution I provided above is helpful in your scenario, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
fredflo27
Level: Powered On

Re: Mismatch regular expression

Hello and thank you for your answer.

 

I used that in ErrorMessage3 (in Identifiant_Datacard3) :

If(Not IsMatch(DataCardValue3.Text; "[se]\.\d{2}\.[fc]\.\d{2}\.[a-h]");"Format invalide (ex : S.03.F.24.B)";Parent.Error)

 

and it's work...but if I press the "save" button it doesn't check the formula that is in the properties of errormessage

Community Support Team
Community Support Team

Re: Mismatch regular expression

Hi @fredflo27 ,

Currently, I could not reproduce your issue on my side. Firstly, the formula I provided above could only be used within the Bahaviour properties of controls, you could not use it within a Text property (Non-bahaviour property) of a control.

 

I agree with your solution almost, you could set the Text property of the ErrorMessage3 Label to your IsMatch formula. In addition, you could also consider set the formula I provided above within the OnChange property of the Identifiant Text Input box, once the mouse focus is moved from your Identifiant Text Input box to other place in your app, the OnChange Event of the Identifiant Text Input box would be fired.

 

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,225)