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
Super User

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
Super User

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

Highlighted
Super User
Super User

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,072)