Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Adding a Filter to a Groupby for a Gallery

Posted on by 302
My current code for the home gallery 
GroupBy(AddColumns(Grants,ProjectText,Project.Value),ProjectText,Data)
 
Description: I am building a platform for users to mark tasks that are assigned to them complete/put on hold/make comments on them.

My problem is on home screen I have everything grouped by the Project choice column in a sharepoint list. I would like to filter it out to only show users projects that they have tasks assigned to them.

How could this be accomplished?
Categories:
  • Suggested answer
    CU07111156-1 Profile Picture
    CU07111156-1 6 on at
    Adding a Filter to a Groupby for a Gallery
    Hi

    Hopefully I've understood this request, my suggestion:  Filter the results before grouping
    GroupBy(
     AddColumns(
      Filter( Grants, user = current user ),
     ProjectText,Project.Value),
    ProjectText,Data)

    Alternatively, Filter the Resulting group
    Filter(
     GroupBy(AddColumns(Grants,ProjectText,Project.Value),ProjectText,Data),
     user = current user).

    Depending on the layout / Home screen you could also add a "Show My Tasks" Button / Toggle and add a IF to the filter
    Something along the lines of 
     If "My Tasks" equal true
     then Filter & Groupby xyz
     else GroupBy xyz.

    Hope that helps
  • ronaldwalcott Profile Picture
    ronaldwalcott 1,026 on at
    Adding a Filter to a Groupby for a Gallery
    Wouldn't you just replace Grants in your GroupBy with something like Filter(Grants, column in grants = the current user) ?
    How do you identify the projects assigned to a user? Did you use User() to associate the projects with a user?
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard