web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Hide /Show field depen...
Power Apps
Answered

Hide /Show field depending on Multiple selections done in drop down menu

(1) ShareShare
ReportReport
Posted on by 18

Hi ,

Based on the multiple selection done in the drop down menu, I need to hide and show the other field in the power apps.

Eg:

Drop Down Menu has Option A ,B , C and D . The other field needs to be displayed if B is one of the selections . 

 I used Visible 

 

If(DataCardValue2.Selected.Value = "B", true, false) but in this when B and C are selected , it does not work. But when C and B are selected , meaning when B is at the end  then condition works. How to solve this?

 

Categories:
I have the same question (0)
  • Verified answer
    v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @prateek2 ,

    Please try:

    "B" in DataCardValue2.SelectedItems

     

    Best Regards,

    Dezhi

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @prateek2 

    "B" in DataCardValue2.SelectedItems

    if you have just true or false, you can remove the If formula and just use "B" in DataCardValue2.Selecteditems

    see if it helps @prateek2

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @prateek2 

     

    The reason you observe it like this when "B is at the end", is that Selected.Value of a Combo Box control only returns the last selected item. So when you select B last, that's why it works only then.

    So you need to check all the items as @v-dezhili-msft said, so try

    "B" in DataCardValue2.SelectedItems

     

  • prateek2 Profile Picture
    18 on at

    Yes I have tried  "IN" , it does not work when in drop down B and C are selected

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @prateek2 If you are using Selected.Value that one only returns the last selected item

    You must use in when using SelectedItems

    so 

    "B" in DataCardValue2.SelectedItems

    not Selected.Value but SelectedItems

  • prateek2 Profile Picture
    18 on at

    "B" in DataCardValue2.Selecteditems does not work. Works only When only B is selected from drop down. the moment B and C are selected , the condition fails

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @prateek2 I don't think you are using a Drop down, since Drop down only allows one selection, I think it is a Combo box. Are you sure it's a Drop down? Could you provide a screenshot which control you are using?

     

    On my side I cannot reproduce your issue, so I probably cannot help you further
    @v-dezhili-msft  do you have any idea why @prateek2 sees this behavior? I don't have that behavior on my side.

  • prateek2 Profile Picture
    18 on at

    Yes it is a combo box only my bad. Still trying to learn.

    I am using the visible condition on the other field as you stated  "B" in dataCardValue2.Selected.value.

    So when B and C are selected from the combo box , the other field is not visible. It is visible only when B is selected.

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    Do not use "B" in dataCardValue2.Selected.value.

    instead you must use "B" in DataCardValue2.SelectedItems

    There is a huge difference.

    Selected.Value returns the last selected item only when used in a Combo box Control.

    Only SelectedItems of a Combo box Control has all the selected items.

    See if it helps @prateek2 

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @prateek2 ,

     

    It worked fine in my tests.
    Could you please show your Items property, and the output displayed when you select dataCardValue2.SelectedItems?

     

    vdezhilimsft_0-1671514979924.png

     

    vdezhilimsft_1-1671514979925.png

     

    Best Regards,

    Dezhi

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard