cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iioannou
Helper I
Helper I

Sharepoint form - Email validation field

I have customised a sharepoint list form for edit/new and one of the fields is the email. How can I perform email validation so that it is not saved when the email is not valid. For more info please refer to the screenshot below

 

CaptureEmail.PNG

4 REPLIES 4
Jeff_Thorpe
Super User
Super User

You can try using the IsMatch function when validating the input before it is submitted.

 

IsMatch( "joan@contoso.com", Email )

Here is the documentation: IsMatch function in PowerApps



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thank you Jeff, I understand - where am I using the formula though ? I am using the standard sharepoint save button... 

v-monli-msft
Community Support
Community Support

Hi @iioannou,

 

Please follow below steps:

 

1. Suppose that DataCardValue12 is the name of the label control that stores the email. Set the OnSelect property of your save button to:

 

If(IsMatch( DataCardValue12.Text, Email )=true,SubmitForm(EditForm1),UpdateContext({Var:true}))

2. Insert a Label control, set to:

Label1.Text="*The email is not valid."
Label1.Color= RGBA(255, 0, 0, 1) Label1.Visible=Var

3. Set the OnSuccess property of the EditForm1 to:

Back();UpdateContext({Var:false})

I just tested and this works for me.

Capture.PNG

 

Regards,

Mona

 

 

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

Hi Mona,

 

 

I dont have a save button - I am using the default save button of sharepoint. What do I do in that case ?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,026)