cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
elaaadani
Helper V
Helper V

Selection of an item, restriction of options in another

Hello good afternoon. I have two drop-down fields and would like to make the following query
How can I restrict that if in the X field the user selects "100", only the options 101,103 and 104 are shown in the Y field ?

 

elaaadani_0-1609795250935.png

 

Thank you !

 

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

Hi @elaaadani 

 

Switch(
    Dropdown1.Selected.x,
    "1000",
    Filter(
        Table2,
        y * 1 < 1050
    ),
    "2000",
    Filter(
        Table2,
        y * 1 > 1999 && y * 1 < 3000
    ), etc.
)

 

worked perfectly for me.  I like to use * 1 instead of Value() to convert text to numbers.  It is a shortcut and easier to see in formulas._1.png_2.png

View solution in original post

8 REPLIES 8
Drrickryp
Super User
Super User

Hi @elaaadani 

Your text and your screenshot don't match but I will assume you mean 1000 and 1001, 1003 and 1004.

You would use the Switch() function as follows as the Items property of the dependent dropdown as follows:

 

 

Switch(Dropdown1.Selected.Value,"1000", Filter(list2, y <=1004),
                                "2000", Filter(list2, y>1004 && y <1100),
                                "3000", Filter(list2, y>=1100 && y <1200), etc,
)
                                   

 

 

 

Thank you very much for responding to me
I have some doubts.
The information in the drop-down lists comes from an excel table.
Drop-down 1 is filled with elements from table 1 and drop-down 2 from table 2, as I leave in the image for you to understand.
In that case, how can I implement this? since I get errors even when trying to use "Value" for both the filter and the switch
Thank you in advance

 

 

elaaadani_0-1609852980015.png

 

Drrickryp
Super User
Super User

Hi @elaaadani 

 

Switch(
    Dropdown1.Selected.x,
    "1000",
    Filter(
        Table2,
        y * 1 < 1050
    ),
    "2000",
    Filter(
        Table2,
        y * 1 > 1999 && y * 1 < 3000
    ), etc.
)

 

worked perfectly for me.  I like to use * 1 instead of Value() to convert text to numbers.  It is a shortcut and easier to see in formulas._1.png_2.png

For some reason it doesn't work for me.
elaaadani_0-1609869486634.png

 

I have this in the formula when you select the element

 

Table 1 = First table from excel
Table 2= Second table from excel

 

Soc_1 = First Dropdown

Org_1= Second Dropdown

Switch(
    Soc_1.Selected,
    "1000",
    Filter(
        Table2,
        Org_1 * 1 < 1050
    ),
    "2000",
    Filter(
        Table2,
        Org_1 * 1 > 1999 && Org_1 * 1 < 3000
    )
)

 

Thanks !

Drrickryp
Super User
Super User

@elaaadani 

The only problem I see is that you have not indicated the name of the column selected.  If you put a "." after Selected, does Intellisense indicate a choice?_1.png

elaaadani
Helper V
Helper V

If I select 1000 in the drop-down list 1, should I specify the column in the excel table where the information comes from ? That is to say
Soc_1.Selected.Table1, "1000" ?

What is the column name in your Table1

Table 1: Soc.

Table 2: OrgC

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

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.

Users online (2,993)