cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CindyZ
Level: Powered On

Primary, Secondary and Tertiary Drop Down Lists - Limit Selections

I have a list of reasons for wanting to attend a specific meeting.  I'd like people to select their Primary, Secondary and Tertiary reasons for wanting to attend the meeting from a list of about 6 reasons but never be able to duplicate a choice.  How would I go about doing this?   Right now, I have three drop down boxes (Primary, Secondary, Tertiary) that all pull from the same Table/List of Reasons.  

 

Table/List of Reasons

Reason 1

Reason 2

Reason 3 

Reason 4

Reason 5

Reason 6

 

If I select Reason 4 in my primary dropdown, then I don't want that to show as an option in my secondary or tertiary  dropdowns. If I select Reason 1 in my secondary dropdown, then I don't want Reason 4 or Reason 1 to show up in my tertiary dropdown since both of them had been selected in the previous two dropdowns. 

 

Thanks for any help you may be able to offer!  

5 REPLIES 5
tchin-nin
Level 10

Re: Primary, Secondary and Tertiary Drop Down Lists - Limit Selections

Hi @CindyZ

 

I would probably filter all my dropdowns to show all reasons but the one selected before.

Dropdown1.Items : Filter('List of Reasons',Reason <> Dropdown2.Selected.Value && Reason <> Dropdown3.Selected.Value)
Dropdown2.Items : Filter('List of Reasons',Reason <> Dropdown1.Selected.Value && Reason <> Dropdown3.Selected.Value)
Dropdown3.Items : Filter('List of Reasons',Reason <> Dropdown1.Selected.Value && Reason <> Dropdown2.Selected.Value)

Théo

 

 

 

Highlighted
CindyZ
Level: Powered On

Re: Primary, Secondary and Tertiary Drop Down Lists - Limit Selections

So, right now my Items reads as follows: Choices('ListOfReasons'.Secondary). Where do I put the "choices"?

Also, thanks so much for your excellent explanation.  I never dreamed it "might" be as easy as you proposed since I'm new to this and don't know what I don't know!  

TimRohr
Level 10

Re: Primary, Secondary and Tertiary Drop Down Lists - Limit Selections

The Choices() function returns a table. The Filter() function expects a table.

 

So you should just be able to substitute your Choices() statement into the Filter. If your column name is "Secondary", then you should be able to modify Theo's ( @tchin-nin ) suggestion to be:

 

Dropdown1.Items : Filter(Choices('ListOfReasons'.Secondary),Secondary <> Dropdown2.Selected.Value && Secondary <> Dropdown3.Selected.Value)
Dropdown2.Items : Filter(Choices('ListOfReasons'.Secondary),Secondary <> Dropdown1.Selected.Value && Secondary  <> Dropdown3.Selected.Value)
Dropdown3.Items : Filter(Choices('ListOfReasons'.Secondary),Secondary <> Dropdown1.Selected.Value && Secondary <> Dropdown2.Selected.Value)

 

CindyZ
Level: Powered On

Re: Primary, Secondary and Tertiary Drop Down Lists - Limit Selections

Thanks so much to both of your for your help.  I am still stumped on this and below I'll provide more information.  I keep getting the message invalid argument no matter what I do. I tried three or four different things to no avail.  I'm sure there is a real learning for me here.   

 

Front end Info

I'm working on the secondary form field as opposed to the first or third.

  1. Meetings – List on which my form is based
    1.   default Items value when I pull the field into my form reads as follows:
    2.   ‘Meetings'.Reason_x002d_Secondary 
  2. MeetingReasons – Lookup list
  3. Reason-** Field name from Meeting list (three different fields (primary, secondary, tertiary)
  4. Dc** - Card value (primary, secondary, tertiary)
  5. dcv** - Key card value (primary, secondary, tertiary)

Attempt 1

Trying to follow what came in as the default into my form field (using Meetings)

Filter(Choices(‘Meetings'.Reason_x002d_Secondary),
‘Meetings'.Reason_x002d_Secondary <> ‘Meetings'.Reason_x002d_Primary.Selected.Value
 &&
 ‘Meetings'.Reason_x002d_Secondary <> ‘Meetings'.Reason_x002d_Tertiary.Selected.Value)

 

Attempt 2

Trying to follow exact instructions

Filter(Choices(MeetingReasons.Reason_x002d_Secondary),

Reason_x002d_Secondary <> Reason_x002d_Primary.Selected.Value

&&

Reason_x002d_Secondary <> Reason_x002d_Tertiary.Selected.Value)

 

Attempt 3

Kind of made sense to me based on using selected values from the key card except that does not match the default to the list “Compliance Investigations’.  If I tried to use all dcv cards, that did not work at all either.

 

Filter(Choices(‘Meetings'.Reason_x002d_Secondary),

Reason_x002d_Secondary <> dcvPrimaryReason.Selected.Value

&&

Reason_x002d_Secondary<> dcvTertiaryReason.Selected.Value)

TimRohr
Level 10

Re: Primary, Secondary and Tertiary Drop Down Lists - Limit Selections

I would think the chances are if you are pulling from a list for your reasons, you are encountering records (rather than a list of just text)... and because of that you can't make comparisons to text without further specificity.

 

I would put a label on my form to show the ‘Meetings'.Reason_x002d_Secondary piece to me, to make sure I am getting what I expect to get. You might need to add a dot and then reference the specific piece that represents text. Then I'd try to do something similar to get the ‘Meetings'.Reason_x002d_Primary.Selected.Value... which might be more involved as you'd have to set a context variable in the OnChange event, and then point to it.

 

Based on the error you describe and the location of the "red" error indicators in your code, this is my expectation of what is going wrong, but maybe @tchin-nin can offer another suggestion.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Tomorrow, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 117 members 3,818 guests
Please welcome our newest community members: