Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

selected dropdown value limited another dropdown list

(0) ShareShare
ReportReport
Posted on by 180

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

Categories:
  • Verified answer
    Unbihexium Profile Picture
    180 on at
    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

  • Verified answer
    v-xida-msft Profile Picture
    on at
    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,

  • yashag2255 Profile Picture
    24,442 Super User 2024 Season 1 on at
    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.
  • Unbihexium Profile Picture
    180 on at
    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

  • Unbihexium Profile Picture
    180 on at
    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

  • yashag2255 Profile Picture
    24,442 Super User 2024 Season 1 on at
    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!
  • SkiDK Profile Picture
    1,016 on at
    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,522 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,890 Most Valuable Professional

Leaderboard