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

selected dropdown value limited another dropdown list

Hello

I would like to make the following:

I have two dropdown selection datacards which contains the same values.
If a value has been selected from one dropdown window, it should not be selectable in the other one.
Does anyone have a hint? 
The dropdown selections have been defined/created in an SP list... if this matters

 

Thanks in advance
regards

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: selected dropdown value limited another dropdown list

HI @Unbihexium ,

Are the "Prufung PM / F&E in Ordung" column and "Prufung PM / F&E Mangel" column both Choice type column in your SP List with same available options?

 

Based on the needs that you mentioned, I think Filter function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the Items property of the "Prufung PM / F&E in Ordung" ComboBox to following:

Choices('Erfassung und Freigabe neuer Artikel 2'.'Prufung PM / F&E in Ordung')

Set the Items property of the "Prufung PM / F&E Mangel" ComboBox to following:

Filter(
Choices('Erfassung und Freigabe neuer Artikel 2'.'Prufung PM / F&E Mangel'),
Value <> DataCardValue76.Selected.Value
)

Note: The DataCardValue76 represents the "Prufung PM / F&E in Ordung" ComboBox within your Edit form. I assume that the "Prufung PM / F&E in Ordung" and "Prufung PM / F&E Mangel" ComboBox are both single selection.

If "Prufung PM / F&E in Ordung" and "Prufung PM / F&E Mangel" ComboBox are multiple Choice selections box, please modify above formula as below:

Set the Items property of the "Prufung PM / F&E Mangel" ComboBox to following:

Filter(
Choices('Erfassung und Freigabe neuer Artikel 2'.'Prufung PM / F&E Mangel'),
Not(Value in DataCardValue76.SelectedItems.Value)
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Unbihexium
Level: Powered On

Re: selected dropdown value limited another dropdown list

Hi Kris

Awesome!! This works as hoped!

 

Filter(
Choices('Erfassung und Freigabe neuer Artikel 2'.'Prüfung PM / F&E Mangel');
!(Value in DataCardValue76.SelectedItems.Value)
)

 

Yup, "Prüfung PM / F&E in Ordnung" column and "Prüfung PM / F&E Mängel" column are both multiple Choice selections boxes with identical values (choices)

I think I understand now the whole magic.

today is a good day!
thousand Thanks Kris Dai

@yashag2255 Thank you for your help, unfortunately it didn't work but I get the filter logic now!

Best regards

View solution in original post

7 REPLIES 7
Highlighted
SkiDK
Level 8

Re: selected dropdown value limited another dropdown list

You could work with collections that ClearCollect() after every change which filters out the selected item.

 

Ex: you selected item with ID = 2

 

DD.OnChange :

    ClearCollect(colOptions, DATASOURCE_TABLE);                //Reset collection with all options

    Remove(colOptions, ID = DD.Selected.ID);                        //Remove selected function

 

Then for the second dropdown you can use as datasource the 'colOptions' which will contain all options but the one from the first dropdown.

 

And if you want to 'reset' the collection, you can just ClearCollect() with the datasource again. You can also make different collections for the first an second dropdown, where the first dropdown modifies the collection for the second dropdown if the first dropdown needs its own collection.

Dual Super User
Dual Super User

Re: selected dropdown value limited another dropdown list

Hi @Unbihexium 

 

You can directly set the filter on second Combobox inside the datacard as:
 
Filter(DataSource,!(Value1 in ComboBox1.SelectedItems.Value1))
 
Here, DataSource needs to be replaced with the actual name of data source and only those values will be displayed which are not selected in Combobox1(usually DataCardsValue10 in data cards) control
 
Hope this Helps!!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Unbihexium
Level: Powered On

Re: selected dropdown value limited another dropdown list

Hi yashag2255, Hi SkiDK

Thanks guys for your quick reply!

I think the solution from yashag2255 will do it. I will need a bit time to try it out, as I no more in the office. 
Will update here ASAP

Thanks again!
regards

Unbihexium
Level: Powered On

Re: selected dropdown value limited another dropdown list

Hi yashag2255

 

I've tried with the recommended syntax but I have no luck with that.

I get an error with this ...  probably I did something wrong

Error message: Invalid argument type. table values can not be used in this context.
Filter('Erfassung und Freigabe neuer Artikel 2'.'Prüfung PM / F&E Mängel';!(DataCardValue76.SelectedItems.Value in 'Prüfung PM / F&E in Ordnung_DataCard1'))

I put that in the "Items" field in Powerapps
'Erfassung und Freigabe neuer Artikel 2'.'Prüfung PM / F&E Mängel' =  'SharePoint List'.'Column name' which should be filtered 
DataCardValue76.SelectedItems.Value = the selected dropdown choices from the datacard (Prüfung PM / F&E)

'Prüfung PM / F&E in Ordnung_DataCard1' = the name of the DataCard where to find DataCardValue76

 

actually I've tried different ways but I get always an error

Dual Super User
Dual Super User

Re: selected dropdown value limited another dropdown list

@Unbihexium 

 

That might be happening because you have incorrectly placed the attributes inside the formula, your formula should be:
 
Filter('Erfassung und Freigabe neuer Artikel 2'; !('Prüfung PM / F&E Mängel' in DataCardValue76.SelectedItems.Value)).'Prüfung PM / F&E Mängel'
 
Please make sure Value is the correct Column Name referred in SelectedItems of the First ComboBox. This can be verified by the selecting the values inside the suggestions that PowerApps provide.
Community Support Team
Community Support Team

Re: selected dropdown value limited another dropdown list

HI @Unbihexium ,

Are the "Prufung PM / F&E in Ordung" column and "Prufung PM / F&E Mangel" column both Choice type column in your SP List with same available options?

 

Based on the needs that you mentioned, I think Filter function could achieve your needs. I have made a test on my side, please take a try with the following workaround:

Set the Items property of the "Prufung PM / F&E in Ordung" ComboBox to following:

Choices('Erfassung und Freigabe neuer Artikel 2'.'Prufung PM / F&E in Ordung')

Set the Items property of the "Prufung PM / F&E Mangel" ComboBox to following:

Filter(
Choices('Erfassung und Freigabe neuer Artikel 2'.'Prufung PM / F&E Mangel'),
Value <> DataCardValue76.Selected.Value
)

Note: The DataCardValue76 represents the "Prufung PM / F&E in Ordung" ComboBox within your Edit form. I assume that the "Prufung PM / F&E in Ordung" and "Prufung PM / F&E Mangel" ComboBox are both single selection.

If "Prufung PM / F&E in Ordung" and "Prufung PM / F&E Mangel" ComboBox are multiple Choice selections box, please modify above formula as below:

Set the Items property of the "Prufung PM / F&E Mangel" ComboBox to following:

Filter(
Choices('Erfassung und Freigabe neuer Artikel 2'.'Prufung PM / F&E Mangel'),
Not(Value in DataCardValue76.SelectedItems.Value)
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Unbihexium
Level: Powered On

Re: selected dropdown value limited another dropdown list

Hi Kris

Awesome!! This works as hoped!

 

Filter(
Choices('Erfassung und Freigabe neuer Artikel 2'.'Prüfung PM / F&E Mangel');
!(Value in DataCardValue76.SelectedItems.Value)
)

 

Yup, "Prüfung PM / F&E in Ordnung" column and "Prüfung PM / F&E Mängel" column are both multiple Choice selections boxes with identical values (choices)

I think I understand now the whole magic.

today is a good day!
thousand Thanks Kris Dai

@yashag2255 Thank you for your help, unfortunately it didn't work but I get the filter logic now!

Best regards

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,730)