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 / Trying to apply Regex ...
Power Apps
Answered

Trying to apply Regex to a e-mail field, getting "Error where ParenClose is expected"

(0) ShareShare
ReportReport
Posted on by 67

Hi All,

 

Hope you can assist. Have a faily straight forward requirement to add some Regex to a e-mail field too ensure that the entry is correct. However I get the following error when entering my formula:

TheAvo1_0-1696847477227.png

This is being entered on the OnChange Type for the text field.

TheAvo1_1-1696847528088.png

and here is a sample of the formula I'm entering:

 

If

(

    IsMatch(OriginatorEmail.Text,"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"),

    true,

    false

)

 

 

Any assistance would be appreciated, I am a newb on PowerApps 😞

Categories:
  • WarrenBelz Profile Picture
    156,921 Most Valuable Professional on at

    @TheAvo1 ,

    You are entering a formula that returns a Boolean (true/false) result - if you are going to do this OnChange of a Control, you need to set a Variable to it

    UpdateContext(
     {
     varMatch:
     IsMatch(
     OriginatorEmail.Text,"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
     )
     }
    )

    (otherwise it needs to be on a property of a control that can either be true or false (such as Visible)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • TheAvo1 Profile Picture
    67 on at

    Thanks for the prompt reply,

     

    Still no joy, even when you set a variable.

     

    TheAvo1_0-1696850135283.png

     

     

    TheAvo1_1-1696850169481.png

    Any ideas?

  • TheAvo1 Profile Picture
    67 on at

    Some additional info on Issue:

    Query being used: UpdateContext({varisvalidemail:If(IsMatch(OriginatorEmail.Text,"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"),true,false)})

     

    3 errors being given.

    TheAvo1_0-1696865624093.png

     

    TheAvo1_1-1696865660778.pngTheAvo1_2-1696865683219.png

     

  • Verified answer
    TheAvo1 Profile Picture
    67 on at

    Oh my goat! Turns out that Chrome settings meant that I needed to use semi colons and not commas in order to have ANY function work.. sigh. We learn as we go.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard