cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Show error message when invalid email

I'm trying to create a submit form where the user has to enters a valid email.

 

I got the e-mail validation setup with the following:

 

If(IsMatch(DataCardValue5.Text, Match.Email), SubmitForm(EditForm1))

But I also want to show an error message of some sort when the email is not correct or when there is no value entered.

 

I'm fairly new with PowerApps, any help is appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Show error message when invalid email

Hi @Frello 

One way to show an error message is to use the Notify function.

 

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-showerror

 

To use this, you can amend your formula like so:

 

If(IsMatch(DataCardValue5.Text, Match.Email), 
SubmitForm(EditForm1),
Notify("Invalid email address", NotificationType.Error)
)

 

 

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: Show error message when invalid email

Hi @Frello 

One way to show an error message is to use the Notify function.

 

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-showerror

 

To use this, you can amend your formula like so:

 

If(IsMatch(DataCardValue5.Text, Match.Email), 
SubmitForm(EditForm1),
Notify("Invalid email address", NotificationType.Error)
)

 

 

View solution in original post

Super User III
Super User III

Re: Show error message when invalid email

@Frello 

In addition to @timl's Notify function, if you want to actually put a message on your form, you can add a label with your message and set the Visible property to:

   !IsMatch(DataCardValue5.Text, Match.Email)

 

Or even change the color of the textbox, by changing the Fill property of the DataCardValue5 to:

   If(!IsMatch(DataCardValue5.Text, Match.Email), Red, White)  (or whatever colors you want.)

 

Hope this adds a little help.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: Show error message when invalid email

@timl Thank you very much, this is what I was looking for! I got it working.

 

@RandyHayes Thanks a lot for the extra info, this is very helpful!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,566)