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 / Set Variable from filt...
Power Apps
Answered

Set Variable from filtered gallery results

(0) ShareShare
ReportReport
Posted on by 78

Good morning,

 

I would like to filter a gallery in the OnStart and provide a count of the rows that match the filtered criteria. This is what I have but I am not sure how to join the two:
  • Filter('EV PPQ Data Management', GUID(CurAprID) = User().EntraObjectId);   These results would be displayed in gallery "gal_WaitingOnMyAction"
  • I have a button on the menu screen where I would like to display the count of the Gallery: Set(varCountPPQ, CountRows (gal_WaitingOnMyAction.AllItems));
  • HelpWanted17_0-1719246458721.png

     

Categories:
I have the same question (0)
  • Verified answer
    kelseytran Profile Picture
    292 on at

    Hi @HelpWanted17 ,

    You can first set the gallery's items property:

    Filter('EV PPQ Data Management', GUID(CurAprID) = User().EntraObjectId)

    Then on the OnStart property, filter the data and store it in a collection:

    ClearCollect(
     colFilteredData,
     Filter('EV PPQ Data Management', GUID(CurAprID) = User().EntraObjectId)
    );

    Then set the 'Items' property of the gallery to that collection:

    gal_WaitingOnMyAction.Items = colFilteredData

    And in the 'OnSelect' property of your button use this code:

    Set(varCountPPQ, CountRows(colFilteredData))

    To display the count on your menu screen or anywhere else, you can use a label and set its Text property to:

    varCountPPQ

    ------------------------------------------------------------------------------------------------------------------------------
    If I answered your question, please accept my post as a solution and if you liked my response, please give it a thumbs up.

    Thanks!

  • HelpWanted17 Profile Picture
    78 on at

    Freaking Cool!  This works great! Thank 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

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