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 / Dropdown within a gallery
Power Apps
Answered

Dropdown within a gallery

(0) ShareShare
ReportReport
Posted on by 33

I believe what I want to do is not commonly thought of because I haven't found a place (yet) that helps.

I am trying to make an Onboarding app where HR can check to make sure she has done what she needs to for a new employee. It pretty much acts as a check list.

Right now, I have a search bar at the top of my screen where she would enter an employee's name and then a gallery will populate with the check list relative to the searched employee. However, the check list has multiple sections. For example, this is what the data source/table looks like:

ID    Task

1.0   Prior to first day

1.1   Task1

1.2   Task2

1.3   Task3

...

2.0   First day

2.1   Task1

2.2   Task2

2.3   Task3

...

 

I have 4 sections as of right now. There very well could be another way to organize the table/data source more efficiently. HR would like to see the 1.0 - 1.x and 2.0 - 2.x while viewing the list.

The way I have the gallery set up, it will display fine and dandy with the associated checkbox and comment section per gallery item. However, HR would like it set up so that they can drop down and close each section. So, if they clicked on a plus sign which is linked to the first section header (Prior to first day), all of the checklist items under the first section should appear. The same with the other sections. And when they want to close a certain section, they should be able to click the Plus sign (or now minus sign) and then close it back up.

The tricky part (sort of) is that I want to eventually add a feature to the app where HR can add or edit a checklist. Knowing this, I can't just hardcode the sections into the gallery/app.

I'll attach a couple pictures. The one with the plus signs is how I'd like it to function eventually, and the other is how I have working now. Hopefully someone can give some insight or suggestions. Thanks!

Capture2.PNG
Capture.PNG
Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Nyk 

    If I understood you correctly, you are looking to have the task items appear on the same list as the main tasks (Prior to first day, First day, etc.) whenever the user clicks on the Plus icon in the Gallery.

    Something like this photo:

    Nyk.png

    If that is the case, then you can achieve this with a nested Gallery.  You will need to first have a Flexible Height gallery as your main gallery and then a nested Gallery within it.

    Your challenge is a little more to do with the ID of the tasks as they are 1.x type ID's.  I wasn't sure if you were dealing with text ID's or numeric ID's.  Since everything looked a little text like in your samples, I went with the assumption that you have text ID's.

     

    I have attached to this message a sample App that demonstrates everything for you.  It will be easier to look at that than to explain it all.  Download the attachment, then in PowerApps designer, either open an existing or create a new App, then then choose File->Open->Browse and then locate the downloaded app.

     

    Take a look at that and see some of these points.

    1) Look at the OnStart of the App.  That formula has all the Sample data loaded into a Collection.  This is just for demonstration purposes.

    2) Look at the Items property of the GalleryMain control.  By the way, GalleryMain is a felxible height gallery.  In there you will see this formula:

    AddColumns(
     GroupBy(
     AddColumns(taskList, 
     "TaskID", Match(ID, Match.MultipleDigits, BeginsWith).FullMatch, 
     "TaskIDstep", Match(ID, Match.MultipleDigits, EndsWith).FullMatch), 
     "TaskID", 
     "Tasks"),
     "TaskCategory", First(Tasks).Task
    )

    This will take your task list and group it by the major task and then subtasks.  It also gets the first item in the tasks (the .0 item) and uses that for the Category.

     

    3) Look at GalleryNested.  Its Items property is :

    SortByColumns(
     Filter(ThisItem.Tasks, Value(Match(ID, MultipleDigits, EndsWith).FullMatch)>0),
     "ID"
    )
    

    So in this case we just sort the tasks in that group and also filter out the .0 valued item (as that's our main group category)

     

    4) The logic for the Plus and Minus (X in my example) uses an auxiliary collection to keep track of what is expanded and what is not.  Look at the OnSelect of the Icon.  Also look at the Visible property of the GalleryNested.

     

    Take a look through it and see if that addresses your issue.  Feel free to ask questions.

    I hope this is helpful for you.

     

     

     

     

     

  • K-A-R-L Profile Picture
    715 on at

    Hi @Nyk ,

    I agree with @RandyHayes you can achieve this using nestes galleries / sub galleries.

    Here's additional information if you want:

    1. https://powerusers.microsoft.com/t5/Video-Gallery/PowerApps-Filter-Function-and-nested-galleries/td-p/100755 By Shane
    2. https://www.youtube.com/watch?v=ZzQ1t2sQvj by Paul O'Flaherty

    Cheers and best of luck!

     

     

     

  • Nyk Profile Picture
    33 on at

    Oh my gosh... how did I not think of a nested gallery... Well, thank you so much! I haven't tested it quite yet, but this seems to be exactly what I was looking for. I'll be sure to let you know!

  • Nyk Profile Picture
    33 on at

    How would I go about using an sql database table as the data source instead of a collection?

  • Nyk Profile Picture
    33 on at

    Nevermind... I solved it. I was just being dumb. Thanks 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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard