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

Distinct Choices

I have a form that will have 3 dropdown fields and have the same values in each of them.  The ask is that the fields cannot have the same value as the other 2 fields.  So, if a user chooses 7:00 am - 8:00 am start, the other two fields will need to display either 8:30am - 9:30 am and 10:00am - 10:30am start. How can I accomplish that?

 

Choice 1

7:00am - 8:00am start

8:30am-9:30am start

10:00am-10:30am start

 

Choice 2

7:00am - 8:00am start

8:30am-9:30am start

10:00am-10:30am start

 

Choice 3

7:00am - 8:00am start

8:30am-9:30am start

10:00am-10:30am start

1 ACCEPTED SOLUTION

Accepted Solutions
Aaron3Sixty5
Helper I
Helper I

If you want to cascade the results top down, you can add the following code to 3 dropdown controls Items property:

 

Dropdown1

["7:00am - 8:00am start", "8:30am-9:30am start", "10:00am-10:30am start"]

 

Dropdown2

If(
    IsBlank(Dropdown1.SelectedText.Value),
    ["7:00am - 8:00am start","8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="7:00am - 8:00am start",
    ["8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="8:30am-9:30am start",
    ["7:00am - 8:00am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="10:00am-10:30am start",
    ["7:00am - 8:00am start","8:30am-9:30am start"]
)

 

Dropdown3

If(
    //Check for non-selections
    IsBlank(Dropdown1.SelectedText.Value) && IsBlank(Dropdown2.SelectedText.Value),
    ["7:00am - 8:00am start","8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="7:00am - 8:00am start" && IsBlank(Dropdown2.SelectedText.Value),
    ["8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="8:30am-9:30am start" && IsBlank(Dropdown2.SelectedText.Value),
    ["7:00am - 8:00am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="10:00am-10:30am start" && IsBlank(Dropdown2.SelectedText.Value),
    ["7:00am - 8:00am start","8:30am-9:30am start"],

    //Results for 10:00am start
    (Dropdown1.SelectedText.Value="7:00am - 8:00am start" && Dropdown2.SelectedText.Value="8:30am-9:30am start") || (Dropdown2.SelectedText.Value="7:00am - 8:00am start" && Dropdown1.SelectedText.Value="8:30am-9:30am start"),
    ["10:00am-10:30am start"],
    //Results for 8:30am start
    (Dropdown1.SelectedText.Value="7:00am - 8:00am start" && Dropdown2.SelectedText.Value="10:00am-10:30am start") || (Dropdown2.SelectedText.Value="7:00am - 8:00am start" && Dropdown1.SelectedText.Value="10:00am-10:30am start"),
    ["8:30am-9:30am start"],
    //Results for 7:00am start 
    (Dropdown1.SelectedText.Value="8:30am-9:30am start" && Dropdown2.SelectedText.Value="10:00am-10:30am start") || (Dropdown2.SelectedText.Value="8:30am-9:30am start" && Dropdown1.SelectedText.Value="10:00am-10:30am start"),
    ["7:00am - 8:00am start"]

)

 

dd-example.JPG

View solution in original post

4 REPLIES 4
Drrickryp
Super User II
Super User II

Hi @thressac 

Filter the list based on the choice <> the first dropdown.  In the example, I used listboxes to show the choices.  The result would be the same for dropdown controls. 

_1.png

@Drrickryp , can you provide an example please?

Aaron3Sixty5
Helper I
Helper I

If you want to cascade the results top down, you can add the following code to 3 dropdown controls Items property:

 

Dropdown1

["7:00am - 8:00am start", "8:30am-9:30am start", "10:00am-10:30am start"]

 

Dropdown2

If(
    IsBlank(Dropdown1.SelectedText.Value),
    ["7:00am - 8:00am start","8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="7:00am - 8:00am start",
    ["8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="8:30am-9:30am start",
    ["7:00am - 8:00am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="10:00am-10:30am start",
    ["7:00am - 8:00am start","8:30am-9:30am start"]
)

 

Dropdown3

If(
    //Check for non-selections
    IsBlank(Dropdown1.SelectedText.Value) && IsBlank(Dropdown2.SelectedText.Value),
    ["7:00am - 8:00am start","8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="7:00am - 8:00am start" && IsBlank(Dropdown2.SelectedText.Value),
    ["8:30am-9:30am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="8:30am-9:30am start" && IsBlank(Dropdown2.SelectedText.Value),
    ["7:00am - 8:00am start","10:00am-10:30am start"],
    Dropdown1.SelectedText.Value="10:00am-10:30am start" && IsBlank(Dropdown2.SelectedText.Value),
    ["7:00am - 8:00am start","8:30am-9:30am start"],

    //Results for 10:00am start
    (Dropdown1.SelectedText.Value="7:00am - 8:00am start" && Dropdown2.SelectedText.Value="8:30am-9:30am start") || (Dropdown2.SelectedText.Value="7:00am - 8:00am start" && Dropdown1.SelectedText.Value="8:30am-9:30am start"),
    ["10:00am-10:30am start"],
    //Results for 8:30am start
    (Dropdown1.SelectedText.Value="7:00am - 8:00am start" && Dropdown2.SelectedText.Value="10:00am-10:30am start") || (Dropdown2.SelectedText.Value="7:00am - 8:00am start" && Dropdown1.SelectedText.Value="10:00am-10:30am start"),
    ["8:30am-9:30am start"],
    //Results for 7:00am start 
    (Dropdown1.SelectedText.Value="8:30am-9:30am start" && Dropdown2.SelectedText.Value="10:00am-10:30am start") || (Dropdown2.SelectedText.Value="8:30am-9:30am start" && Dropdown1.SelectedText.Value="10:00am-10:30am start"),
    ["7:00am - 8:00am start"]

)

 

dd-example.JPG

View solution in original post

@Aaron3Sixty5  this worked like a charm!  thank you!

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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 (2,040)