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 / Need help with visible...
Power Apps
Answered

Need help with visible property with multiple conditions

(0) ShareShare
ReportReport
Posted on by 28

I have been scouring the interwebs for an example like mine but have not come across one. 

At face value the need is simple I have a picture (yellow stop light) in a gallery that I want to be conditional. However my gallery is also filtered by the visible property due to one of the filters being a multi choice field in sharepoint. I believe this creates my problem. The work around I am using to filter the gallery is I created a group for all the items in the gallery and in the visible property of the group I have 

ddproduct.Selected.Value in ThisItem.Product.Value || ddproduct.Selected.Value=""

where ddproduct = a drop down created to filter the gallery. Its Items are ["","RI", "CI", "AV", "PNM", "PB","ROCC"]

ThisItem.Product is the choice field in sharepoint.

 

Now this all works fine if I exclude the empty value in my dropdown item ("" in the drop down and exclude the || ddproduct.Selected.Value=""), but I need the gallery to display all products and then let the user filter accordingly. So then to compound the need I have two more requirements, I need to display a picture based on a sharepoint list entry (ThisItem.Flag) and some items in the sharepoint list I want hidden so I have a field (ThisItem.HideInGallery) that I am looking at. So my attempt was this;

ThisItem.Flag="Caution"&& ddproduct.Selected.Value in ThisItem.Product.Value || ddproduct.Selected.Value="" && !ThisItem.HideInGallery

So if I select an item in the drop down it works as shown here

MarkFay1_0-1660074762658.png

But as soon as I select the empty value in the drop down, everything gets a yellow light

MarkFay1_1-1660074987248.png

 

Is there a limit to the number of conditions I can use in the visible property, or am I not writing the command correctly (likely).

 

Thanks

Categories:
I have the same question (0)
  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Don't put it on the group visability, put it on the stoplight image. 
    ddproduct.Selected.Value in ThisItem.Product.Value && ddproduct.Selected.Value <>"" 

     

    That should work if I understand correctly. 

     

  • MarkFay1 Profile Picture
    28 on at

    Yea I was just trying that. I added the ThisItem.Flag="Caution" only to the spotlight and that did not fix it. I just tried 

    ddproduct.Selected.Value in ThisItem.Product.Value && ddproduct.Selected.Value <>""  and that yielded no results

    MarkFay1_0-1660077503819.png

     

  • Verified answer
    Tony_Bowes_BP Profile Picture
    280 on at

    To answer the last question, no, there isn't a limit to the visible property (or at least we haven't hit one with dozens of lines of conditional logic). There is a practical limit in that your logic starts to become unreadable without braces and eventually using AND() / OR () functions. Eg: 

    If(
      Or(

        And(

          Scenario1criteria,

          Scenario1criteria2

        ),

        And(

          Scenarion2criteria,

          Scenario2criteria2

        )

      ),
      true,
      false
    )

     

    For the visibility, it looks like there are 2 separate issues, the visibility of the image WITHIN the item being displayed (based off a flag), and the visibility of the item itself (based off filtering criteria). 

     

    If this is a correct interpretation of the problem, then try setting the visibility of the image to: ThisItem.Flag="Caution"

     

    Then set the visibility of the group to:

    If(
      And(

        !ThisItem.HideInGallery,

        Or(

          ddproduct.Selected.Value in ThisItem.Product.Value,

          ddproduct.Selected.Value=""

        )

      ),

      true,
      false
    )

     

    Please excuse any typos.

  • MarkFay1 Profile Picture
    28 on at

    YES!!! that worked.. Thank you!

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard