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!
Solved! Go to Solution.
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)
)
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)
)
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.
@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!
User | Count |
---|---|
141 | |
135 | |
77 | |
75 | |
69 |
User | Count |
---|---|
224 | |
190 | |
66 | |
62 | |
55 |