cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

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