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 / Question on Hiding a D...
Power Apps
Unanswered

Question on Hiding a Datacard Based on the Value of a Multi-Select Options Datacard

(0) ShareShare
ReportReport
Posted on by 49

Hi Folks,

 

So I couldn't find a suggestion or solution for this that I can get working. I am able to and know how to hide a datacard based on a selection from another datacard if it was a single options field (the datacards/fields are all from a Sharepoint list). I am however getting stuck with getting it to work based on the selections from another datacard which is a multi-select options field.

 

Currently the formula I have (which does not work) is as follows for Visible:

 

("SIJS" in Type_of_Case_DataCard1.SelectedItems.Value), true, false

 

I'm assuming my syntax is wrong here?

 

 

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi,

    can you please try below formula -

    If(SIJS" in Type_of_Case_DataCard1.SelectedItems,true, false)

  • SBax Profile Picture
    1,348 on at

    @NandiniBhagya20 @kddsling 

     

    there is a missing " in the above

     

    I tested this using If("John Smith" in ComboBox1.SelectedItems.'Account Name',true,false)

     

    the red text is the string I am searching for, blue text is the values selected in the combobox field (I used dataverse so needed the .'Account Name', if your field is a text field as opposed to a record, you won't need this)

     

    I think the correct formula is:

     

     

    If("SIJS" in Type_of_Case_DataCard1.SelectedItems,true,false)

     

     

  • kddsling Profile Picture
    49 on at

    Ah. this is good. We are getting closer. So, now what happens is that the field I have set your formula on for Visible, it's now hidden on the form. What's unfortunate however is that even if I did pick the SIJS option, the hidden datacard did not become visible.

     

    This is what the formula looks like currently:

     

    If("SIJS" in DataCardValue4.SelectedItems,true,false)

     

    I'm using DataCardValue4 as that is the actual combobox field. The Type_of_Case_Datacard1 was actually the name for the entire datacard containing the combobox field.

  • SBax Profile Picture
    1,348 on at

    In your datasource, is the field that contains SIJS a plain text field or a lookup?

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Apologies, there should be “before SIJS in above formula

    @SBax 

    thanks for pointing it out 

  • kddsling Profile Picture
    49 on at

    Datasource is a Sharepoint list. The field is a Choice field that allows for multiple selections.

  • SBax Profile Picture
    1,348 on at

    I have managed to replicate this and am getting similar behaviour (i.e. its hidden it it should be, but not visible if it the combobox field does not contain "SIJS")

     

    I'm working on a solution now, please bear with me for 30 mins

  • SBax Profile Picture
    1,348 on at

    @kddsling 

     

    I have a solution, you need to concatenate the selected items into a Comma Separated String, then check if that string contains SIJS

     

    to do this you would use Concat(ComboBoxName.SelectedItems,Value , ", ")

     

     

     

    We could also simplify by removing the if since the in statement will return true/false anyway

     

     

    "SIJS" in Concat(DataCardValue4.SelectedItems,Value , ", ")

     

     

     

  • Verified answer
    rohitsbots Profile Picture
    280 on at

    @kddsling Instead of using Type_of_Case_DataCard1 use the DataCardValue. In my case

     

    Data Card Name: TypeofCase_DataCard1

    Data Card Value: DataCardValue8 (Select the combobox to see this)

     

    You Visible formula should be--> "SIJS" in DataCardValue8.SelectedItems.Value

     

    rohitsbots_0-1660154550154.png

     

  • kddsling Profile Picture
    49 on at

    @rohitsbots Thank you graciously for the solution! This appears to be working.

     

    @SBax  Thank you graciously for your solution as well! I will test it separately (more tools for the toolbox!) just to see it working. I used Rohitsbots solution in my actual project though as that was just a bit cleaner and streamlined.

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 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard