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 / Conditional visibility...
Power Apps
Unanswered

Conditional visibility - dropdown box

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I want to make a button visible if any one of several dropdown values is selected. I was trying to build up the statement using the Or/ || syntax but this isn't working.

 

Here is the example of what I tried:

 

If ("Text from Dropdown 1"||"Text from Dropdown 2" in Dropdown1.Selected.Value, true)

 

 

Is it possible to set the button's visibility based on one statement, or do I need a multiple instances of the button each with one statement for each condition that makes it visible?

Categories:
I have the same question (0)
  • Verified answer
    bean Profile Picture
    568 on at

    If( Dropdown1.Selected.Value = "condition1" || Dropdown1.Selected.Value = "condition2", true, false)

     

    Try that 🙂

     

    Sean

     

     

     

     

  • Verified answer
    nickduxfield Profile Picture
    497 on at

    You can go about this a few ways.

     

    The simple approcah is:

    In the button's Visible control field:

     

    If(Dropdown.Selected.Value="Text from Dropdown 1", true,false)

     

    Perhaps you need to create another list to assist you in your rules. You can compare values without the need to keep adjusting the syntax, it a lot more managable.

    Then you can create syntax on a filter to show the button.

     

    Create another list for example with 1 column, then create a collection from that. Collect(ButtonKeywordsCollection,'ButtonKeywords')

    Title: ButtonKeywords

    Now on the buttons Visible control field:

     

    if(Dropdown.Selected.Value = Lookup(ButtonKeywordCollection,Dropdown.Selected.Value = Column1,Column1,true,false))

    if(Dropdown.Selected.Value || Dropdown2.Selected.Value = Lookup(ButtonKeywordCollection,Dropdown.Selected.Value = Column1,Column1,true,false))

    This syntax may be different from SharePoint list and an excel sheet.

     

    You can come up with methods like this is you think inline syntax will get too unmanageable.

     

  • Community Power Platform Member Profile Picture
    on at

    Works beautifully. Thanks so much, Sean.

  • Community Power Platform Member Profile Picture
    on at

    This is very clever and works great. Thanks Nick!

  • Stijn007 Profile Picture
    155 on at

    Hey,

     

    I tried this formula bit this didn't work for me? 

    Does anybody knows what i mdoing wrong? 

     

     

     

  • nickduxfield Profile Picture
    497 on at

    Dont referene the DataCard. but the DataCard Value i.e Dropdown.value

    1. Find out the name of the dropdown control in the datacard and change it to better reference, ill use 'DropDownControl1'. I usually replace all controls like this DataCard_MyABBR, DataCardKey_MyABBR, DataCardValue_MyABBR
    2. Check the lookup values in the DropDown control. If they reference another list like
      1. [0,1,2,3,4,5,6] then it will be DropDownControl.Value because its a number type.
      2. ["Item1","Item2","Item3","Item4"] then it will be text. You need to reference the column DropDownControl.Column (DropDownControl.ItemName)
      3. If its static items that you entered in its a single colum ["Item1","Item2","Item3","Item4"] so it will be .Value

    If(DropDownControl.Column = "Station", true, false)

     

    You can get quite complex if you need by doing things like so.

     

    If(DropDownControl.Column in ["Station","Shop","Park], true, false)

    If(DropDownControl.Column in ReferenceCollection.Items, true, false)

     

  • Mayurs05 Profile Picture
    30 on at

    If you have multiselect dropdown values and you want to have conditional visibility you can use the following condition in visible property of that Card or whatever,

     

    If(CountIf(DataCardValue.SelectedItems,Value="Selection Required")>0,true,false)

  • Ubertortle Profile Picture
    52 on at

    @bean wrote:

    If( Dropdown1.Selected.Value = "condition1" || Dropdown1.Selected.Value = "condition2", true, false)

     

    Try that 🙂

     

    Sean

     

     

     

     


    How would I go about doing this if I am referencing a datacard from a Form? 

    example:

    Form: Form5,

    DataCard: Test Data Card,

    DataCardValue: DataCardValue76. 

  • Community Power Platform Member Profile Picture
    on at

    I have a multi-select dropdown DataCardValue47 containing values (Individual, Third Party, Contractors). 

     

    I want to show/hide DataCard1 when

    Selected values in the DataCardValue47 are Individual, Third Party, Contractors

    OR

    Individual, Third Party

    OR

    Individual, Contractors)

    OR

    Individual

     

    Don't show when selected values are 

    Third Party, Contractors

    Third Party

    Contractors

     

    Visible

    If(DataCardValue47.Selected.Value = "Individual", true, false) --- This condition works fine.

    Please advise the correct logic. 

     

    Logic i was trying
    If(DataCardValue47.Selected.Value = "Individual", true, false) ||

    If(DataCardValue47.Selected.Value in ["Individual","Third Party","Contractors"] but data card still shows when i just select Third Party or Contractors

     

  • Suchithra_A Profile Picture
    88 on at

    Hi,

     

    If I select multiple values from the dropdown.  How to write IF statement to make visible a datacard.

     

    Regards,

    Suchithra

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard