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

How to validate multiple dropdowns

As the title implies, my customized Sharepoint form is using multiple dropdowns for data entry. I'm trying to validate the form to ensure that at least one of these dropdowns is not empty. This formula works for ONE dropdown: 

If(IsBlank(Dropdown1.Selected.Value), Notify("You must fill out of one the dropdowns", NotificationType.Error,3000), SubmitForm(SharePointForm1))

 

However, if I modify it to this:

If(IsBlank(Dropdown1.Selected.Value) Or IsBlank(Dropdown2.Selected.Value), Notify("You must fill out of one the dropdowns", NotificationType.Error,3000), SubmitForm(SharePointForm1))

 

it's wanting to have both dropdowns (Dropdown1 and Dropdown2) to have value before it submits. 

 

Any ideas? 

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@m15433b 

If(IsBlank(Dropdown1.Selected.Value) And IsBlank(Dropdown2.Selected.Value), Notify("You must fill out of one the dropdowns", NotificationType.Error,3000), SubmitForm(SharePointForm1))

View solution in original post

4 REPLIES 4
Drrickryp
Super User
Super User

@m15433b 

If(IsBlank(Dropdown1.Selected.Value) And IsBlank(Dropdown2.Selected.Value), Notify("You must fill out of one the dropdowns", NotificationType.Error,3000), SubmitForm(SharePointForm1))

View solution in original post

Thanks for the suggestion, but doesn't the 'And' operator (instead of 'Or') imply that both dropdowns need to have value? I want the form to validate as long as there is at least one dropdown that is not blank. 

Drrickryp
Super User
Super User

 

If( 
   !IsBlank(Dropdown1.Selected.Value) Or 
   !IsBlank(Dropdown2.Selected.Value),SubmitForm(SharePointForm1),
    Notify("You must fill out of one the dropdowns", NotificationType.Error,3000)
)

@m15433b 

Isn't that what the AND statement says, if both are blank, then send the notification, otherwise submit the form. 

Ok, I was thinking of this: !IsBlanlk(....). I tried your suggestion it and it works. The whole time I had the conditions backwards! Thanks for your help. Will mark your answer as the solution. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,587)