cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frello
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
v-monli-msft
Community Support
Community Support

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
v-monli-msft
Community Support
Community Support

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

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (21,425)