cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thressac
Helper I
Helper I

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

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

@Aaron3Sixty5  this worked like a charm!  thank you!

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,321)