cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Community Support
Community Support

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.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

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.

View solution in original post

Highlighted
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
Frequent Visitor

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,053)