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 III
Super User III

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.
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,109)