cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vhutali
Microsoft
Microsoft

valid email address in textinput

how do I make sure the textinput field accepts only the valid email address? in a case where the a user needs to submit their details in order to be contacted there after

1 ACCEPTED SOLUTION

Accepted Solutions
LRVinNC
Resident Rockstar
Resident Rockstar

Use the IsMatch function to verify the format matches the pattern for an email address.  
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-ismatch

 

Here I set a flag to indicate I have a properly formatted email.
Set(ValidEmail, If(IsMatch(TextInput1.Text, Email ), true, false)))

LRVinNC

------------------
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.

View solution in original post

4 REPLIES 4
LRVinNC
Resident Rockstar
Resident Rockstar

Use the IsMatch function to verify the format matches the pattern for an email address.  
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-ismatch

 

Here I set a flag to indicate I have a properly formatted email.
Set(ValidEmail, If(IsMatch(TextInput1.Text, Email ), true, false)))

LRVinNC

------------------
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.

Hi @LRVinNC

 

thanks for assisting  

 

on what property of the textinput should I put that formula?

It depends on when you want your validation to occur.  If you want immediate feedback to the user at the point they enter the value, then you can put it in the On Change action of the TextInput control. 

 

If you want to do all your validation at once when the user submits their entries, you can make it part of the On Select for a Submit (or other processing) button.

LRVinNC

------------------
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.
alrez
Community Support
Community Support

Hi,

 

It looks like LRV was able to answer your questions on how to add this functionality to PowerApps. I just wanted to add in a bit more information for learning here. Feel free to take a look.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-ismatch

 

Regards,

 

Alex

 

-------

 

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,514)