cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frello
Level: Powered On

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

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.
Frello
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 230 members 5,037 guests
Please welcome our newest community members: