cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bsimon
Helper II
Helper II

Datacard validation -e mail

Hi

 

I am trying to run a datacard (datacardValue3) validation on email form field  to only show the error if a proper email has not been entered. I have a button to submit the form and only then the errors must show

 

The SharePoint email field is required field.. Here is visible property of my ErrorMessage3 and its text property set to " enter a valid email ""

When the form is run, it does not check for a proper email nor does it display the error . Can you please help?>

 

 

bsimon_1-1598039232960.png

 

 

3 REPLIES 3
PowerAddict
Super User
Super User

Would you not want to test this before submitting the form? I am assuming you are using SubmitForm and it is before the expression you shared. Also assuming this error label is inside the form's data card that has DataCardValue3 text input control. 

 

If so, can you try this on the submit button's OnSelect? 

If(
    IsMatch(
          DataCardValue3.Text, 
          Email
    ) && Parent.DisplayMode = DisplayMode.Edit,
    false, 
    true
)

Let me know if this works or if I misunderstood something. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

    

rubin_boer
Super User
Super User

hi there just a suggestion:

why not have the hint text displaying the formatting required and have fill or colour set to

If(IsMatch(Self.Text,Email)=true,White,Tomato) this way the user will see a red-ish color when the format fails validation

hi @PowerAddict 

 

Thank you. I have many fields on my form that need validation so I am using this to goto next screen

bsimon_0-1598050215099.png

and this works but the Error shows immediately as the page loads and does not go away until the field is filled.

The other fields error correction works as intended, only displays when someone does not fill in something.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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