cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,544)