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

Show error for multiple card after submit

Add user.PNG

 

I'm trying to create an error when the "Phone" card does not have less then 10 characters.

 

But I also have a card with e-mail that checks if the card contains a valid email. I currently have the following in the submit button for the e-mail:

 

 

If(IsMatch(DataCardValue5.Text, Match.Email), 
   SubmitForm(EditForm1),
   Notify("Invalid email address", NotificationType.Error)   
)


 

Is it possible to also add an error if the "Phone" card does not have 10 characters? 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Show error for multiple card after submit

Hi @Frello ,

 

Please use below formula to achieve your need:

If(!IsMatch(DataCardValue5.Text, Match.Email), 
   Notify("Invalid email address", NotificationType.Error),
   Len( DataCardValue4.Text )<10,
   Notify("Invalid phone number", NotificationType.Error)
   SubmitForm(EditForm1),     
)

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Community Support Team
Community Support Team

Re: Show error for multiple card after submit

Hi @Frello ,

 

Please use below formula to achieve your need:

If(!IsMatch(DataCardValue5.Text, Match.Email), 
   Notify("Invalid email address", NotificationType.Error),
   Len( DataCardValue4.Text )<10,
   Notify("Invalid phone number", NotificationType.Error)
   SubmitForm(EditForm1),     
)

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Show error for multiple card after submit

@Frello 

Also, in addition to the suggestion by @v-monli-msft if you want actual validation of 10 numeric digits (in the case that a user types "(123) 456-7890" - which would be 14 characters), you might consider this formula:

 

If(!IsMatch(DataCardValue5.Text, Match.Email), 
   Notify("Invalid email address", NotificationType.Error),
   Len(Concat(Filter(Split(DataCardValue4.Text, ""), Result in [0,1,2,3,4,5,6,7,8,9]),Result))<10,
   Notify("Invalid phone number", NotificationType.Error)
   SubmitForm(EditForm1),     
)

This will then check the length of only numbers in your text box.

 

Hope this adds something for you.

 

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

Re: Show error for multiple card after submit

@v-monli-msft  Thank you very much this is working. I had a simulair setup except I had the "SubmitForm" on the wrong place!

 

@RandyHayes Thank you for the extra information. I'm new to powerapps so this helps a lot!

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Top Community Contributors for September  2019

Top Community Contributors for September 2019 🎉🎉

Let's thank our top community contributors

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

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

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