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 gallery item if n...
Power Apps
Answered

Hide gallery item if no sub-gallery items

(0) ShareShare
ReportReport
Posted on by 2

Have a problem trying to solve this. Scenario is gallery of Manufacturers (from SP manufacturer list) and sub-gallery of Models (from SP model list). Not all of the Manufacturers have had Models entered into the list, so I want to hide those Manufacturer gallery items that do not have any Models.

 

Tried to use countif on the Models list and set the Manufacturer gallery Visible property but they all get hidden?

 

Any ideas would be appreciated.

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

    Hi @rmdevelop 

    Is your subgallery inside the main gallery or outside in a different gallery control?  Perhaps you could also post a screenshot. 

  • rmdevelop Profile Picture
    2 on at

    Hi  Drrickryp,

     

    It is outside in a different gallery control.

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    Delete - wrong thread

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @rmdevelop 

    You can use the AddColumns() function to accomplish your goal.  I would do as follows in the Items property of the Manufacturers gallery:

    !IsBlank(
     AddColumns(
     Manufacturers,"Model",Lookup(
     Models,ManufacturerID=ID
     ),"Model"
     )
    )

    This formula should only show Manufacturers who have a Model in the Models list.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @rmdevelop ,

    Could you please share a bit more about the relationship between the Manufacturers List and Model List?

    How do you set up the relationship between the Manufacturers List and Model List? Using LookUp type column?

     

    Based on the issue that you mentioned, I think there is something wrong with your operation. You could not use the Visible property of the Gallery control to hide the Gallery Items.

     

    I assume that you set up a LookUp field in your Model List, to reference specific Manufacturers Name from your Manufacturers List, is it right? The relationship may look as below:

    6.JPG

     

    I have made a test on my side, please take a try with the following workaround:

    Set the Items property of the Manufacturer Gallery to following:

    Filter(
     'Manufacturer List',
     !IsBlank(LookUp('Model List', Manufacturer_Name.Value = 'Manufacturer Name'))
    )

    or

    Filter(
     'Manufacturer List',
     !IsEmpty(Filter('Model List', Manufacturer_Name.Value = 'Manufacturer Name'))
    )

    Note: The Manufacturer_Name column (Lookup type) in your 'Model List' reference values from the 'Manufacturer Name' column in your 'Manufacturer List'

     

    You could also consider try the following formula:

    Filter(
     'Manufacturer List',
     'Manufacturer Name' in Concat('Model List', Manufacturer_Name.Value & ";")
    )

     

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

  • rwcinkc Profile Picture
    4 on at

    I have a similar scenario except I linked the two tables by ID rather than the lookup function.   How does that change the solution?

     

    My use case is

    List1=ListOfEquipment.  Column ID

    List2=ListOfVulnerabilities.   Column ID_RemediationSteps

     

    Its a 1 to many relationship.  One equipment can have multiple vulnerabilities.  

     

    The list of all equipment has 300 entries. I only want to show a piece of equipment in gallery1 if it has a vulnerability listed in gallery2.  If the equipment has no vulnerability then it should not be displayed in gallery1(equipment list).

     

    I'm also very new to PowerApps.    Thank you in advance

     

     

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard