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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / DataCards Conditional ...
Power Apps
Unanswered

DataCards Conditional Visible based on Multi Select Combo Box

(0) ShareShare
ReportReport
Posted on by

Hi there,

 

I have an app where i have a combo box with multi-select  options. I want to show/hide datacards based on the options selected in the combo box. In the the "visible" control of the datacards i want to show/hide, i have the following formula:

 

If("Fluoro Recycling" in (WastDrop.Selected.Value),true,false)

 

This seems to work perfectly if I select a single option from the drop down list. The datacard appears and data can be entered. However, if i select multiple items from the drop down list, i will still only see a single data card (usually the last one selected).  

Any idea how i can get all the datacards selected to show up?

 

Thanks 🙂

 

Cym

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Try

    If("Fluoro Recycling" in (WastDrop.SelectedItems),true,false)

    Let me know if this helps.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    The Power Addict
    https://thepoweraddict.com
  • Community Power Platform Member Profile Picture
    on at

    Thanks @PowerAddict , but doesn't seem to work :

     

    Error Says: Can't convert this data type. Ppower Apps can't convert this Text to a OptionSetValue (see attached).

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Fair enough. I am assuming that "Fluro Cycling" is one of the options of an OptionSet. Is that correct?

    If so, change the formula to:
    If(OptionSet.'Fluoro Recycling' in (WastDrop.SelectedItems),true,false)

    Let me know if this helps.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    The Power Addict
    https://thepoweraddict.com
  • Community Power Platform Member Profile Picture
    on at

    Hi @PowerAddict.,

    You are correct, that it is one of the options in a CDS option set. I've tried the formula you have proposed, but sadly still no luck!!  Any other ideas?

     

    Thanks so much for your help!

     

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    My apologies, I am finally in front of a computer now. Can you please tell me what the Items property of the combo box is? Also, did you get an error with the above formula?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    https://thepoweraddict.com
  • Community Power Platform Member Profile Picture
    on at

    Don't apologise! I appreciate the help!

     

    The items property of the combo box is set to: Choices('Waste Type')

     

    Several errors:

    Expected Operator.....

    Unexpected characters. The formula contains 'ident' where 'fluoro recyling' is expected

     

     

  • Verified answer
    PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    I recreated your use case. I have a CDS option set called 'Category (Accounts)' and the Items property of the combo box (ComboBox21 in my case) is set to 

    Items = Choices('Category (Accounts)')

    The option set has two values: Preferred Customer and Standard

     

    I then have 2 labels (trying to mimic your data cards):

    1. Label1 has

    Text = "Preferred Customer" 

    and

    Visible = If(!IsBlank(LookUp(ComboBox21.SelectedItems, Text(Value) = "Preferred Customer")), true, false) 

    2. Label2 has

    Text = "Standard"

    and

    Visible = If(!IsBlank(LookUp(ComboBox21.SelectedItems, Text(Value) = "Standard")), true, false) 

     

    This achieves what I think you set out to. Here is a working demo: 

    ComboSelectedItems.gif

     

    Let me know if this helps and if you want to know why I did it this way. 

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    https://thepoweraddict.com

     

  • Community Power Platform Member Profile Picture
    on at

    You legend! That totally seems to have worked!  I'd love to understand that logic, as i don't think i could have figured it out.

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Glad I could help!

    Here's my approach as to how I figured it out:
    1. So, option sets are like tables, so although the values in them seem like text, they are not really text.
    2. With that understanding, I knew I had to reference the option set value in the If condition as OptionSet.Option1 and not "Option1".
    3. Then the "in" condition was still not working because that, to the best of my understanding, is used to check if a string exists in a table or a collection. Since this isnt a string, it wont work.
    4. Given this is just like a CDS entity, the way I use to check if a value exists in an entity is by using LookUp, I decided to use the same here and it worked!

    It was a good refresher for me, so thank you for posting this!

    Good luck with the rest of your app! Feel free to reach out in case of any questions!

    Thanks,
    Hardit Bhatia
    The Power Addict
    https://thepoweraddict.com
  • Suchithra_A Profile Picture
    88 on at

    @PowerAddict .. This is really helpful. Thank you so much for this post.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard