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 / Excluding data when us...
Power Apps
Answered

Excluding data when using ForAll and GroupBy

(1) ShareShare
ReportReport
Posted on by 121

I have an app that allows users to delete data but this adds it to an archive.

 

The delete option patches the Sharepoint list for that record as NO under a column of visible.

 

Below is the current code but im struggling with where i can add the code to only show those records where Yes is in the Visible column

 

ForAll(GroupBy(Command,"GRS","_items"),First(Sort(_items, 'Log Date', SortOrder.Descending)))

 

Your help is very much appreciated

 

Mark

Categories:
  • Verified answer
    KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Hi @Markswan20,

     

    Try using the Filter function:

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-filter-lookup

     

    The following code may work or you may need some trial-and-error:

    ForAll(GroupBy(Command,"GRS","_items"),First(Sort(Filter(_items, Visible = "Yes"), 'Log Date', SortOrder.Descending)))

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • Markswan20 Profile Picture
    121 on at

    1st attempt, amazing thank you 🙂

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    My pleasure! Glad you got it working. Thank you for the update.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • Markswan20 Profile Picture
    121 on at

    Is it possible to use code in the Visible property to fulfil the same requirements?

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    If the results are being displayed in a grid then toggling Visible would leave empty rows, unfortunately.

     

    Also, by filtering on the Visible field in the code example, you may get a smaller dataset returned which would be more performant than returning all rows and then toggling visibility.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard