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 / set a gallery to only ...
Power Apps
Unanswered

set a gallery to only show items based on choice

(0) ShareShare
ReportReport
Posted on by 26

Hello!

I am trying to set a gallery to only show items based on what choice is selected in a connected list. I currently have it set so that the items are only visible when what I want is selected, the code is

If (ThisItem.'Management'.Value = "Not Due", false, true);

but then the template has a bunch of blank space as there are 8 different combo boxes. I either:
A) Need to figure out how to move up the items depending on what is visible and what is hidden

or

B) Figure out how to filter out the data to only show based on the selection. 

 

Thank you!

I'm not sure what the best way is to go about this. 

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,674 Super User 2024 Season 1 on at

    @Morgan_W - option B would be the simplest option. Assuming your data source is SharePoint, and your Choice field is a single-select choice, apply the below into the Items property of your Gallery control:

     

    Filter(
     'Your List',
     Management.Value = "Not Due"
    )

     

    I note you also mention that you want to show items based on what choice is selected. Assuming you have a Dropdown or ComboBox control, and the Items property is:

     

    Choices([@'Your List'].Management)

     

    Then apply the below example instead into the Items property of your Gallery control:

     

    Filter(
     'Your List',
     Management.Value = Dropdown1.Selected.Value
    )

     

  • Morgan_W Profile Picture
    26 on at

    Thank you! I'm using Microsoft lists as my data source. When I filter it out that way it will take out the whole line item for the people who have that choice set as "not due", but I am looking to only have it filter the individual column not the whole item. 

     

    For example, I have people with multiple tests that may be due (such as management, or a certain area they are trained in), and I want it to only show the tests for that individual that are due. 

  • Morgan_W Profile Picture
    26 on at

    If this helps here is a screenshot as an example. I want it to only show what is set as anything other than "Not Due". When I set the visible property to If (ThisItem.'Tech III'.Value = "Not Due", false, true) as an example, it works, but it leaves a lot of blank space. I am trying to figure out how to move the values up depending on what is and is not hidden. 

     

    Morgan_W_0-1710988102698.png

     

  • Ami K Profile Picture
    15,674 Super User 2024 Season 1 on at

    @Morgan_W - what is the structure of your table? I assume each person is recorded in your list as a single item across rows, and each test is split across multiple columns?

  • Morgan_W Profile Picture
    26 on at

    This is how it is set up. I have the name as just text, and each test has 5 choices. 

    Morgan_W_0-1711073263366.png

     

  • Ami K Profile Picture
    15,674 Super User 2024 Season 1 on at

    @Morgan_W - 

     

    I was writing a long response but have decided to move it to a blog post here: 

     

    https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/Unpivot-a-table-to-display-columns-across-rows/ba-p/2675936 

     

    Note however that this solution requires duplicating each name as a separate item, per the number of items which are marked "due", which I do not think is exactly what you're after.

     

    Adding @WarrenBelz & @LaurensM who might have better ideas.

  • Morgan_W Profile Picture
    26 on at

    Thank you so much! Sorry for the really late response but I was able to achieve what I was looking for by using a flexible height blank gallery. Then I changed the height of each box to be 0 for anything set to "not due", and set each X axis to change based on the heights. 

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard