web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Mismatch regular expre...
Power Apps
Answered

Mismatch regular expression

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
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]").
 
Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    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

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

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

     

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

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

    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

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    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,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard