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 / Filter collection on c...
Power Apps
Answered

Filter collection on collect

(1) ShareShare
ReportReport
Posted on by 726

Is there a way to filter a Collection before its displayed in the Gallery? 

 

I have a collection based on a SharePoint list 

Collect(CCRDCollection, CustomerCareRecord)

I then have a filter on this collection 

Filter('CCRDCollection', MasterID = TI_MasterID.Text)

  I would like to filter the collection before it get to eh Gallery to allow me to sent the collection in an email. 

 

 

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

    Hi @amyharkus86,

     

    If you set the gallery Items property to your filtered collection (below), does it display as required?

    Filter('CCRDCollection', MasterID = TI_MasterID.Text)

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

  • amyharkus86 Profile Picture
    726 on at

    @KeithAtherton  Yes the filter displays the items i wish to send in the email, I don't want to send the whole collection just the filtered based on the above filter. 

  • galos Profile Picture
    256 on at

    Have you tried placing all your collect and filter code in the "App" -> "OnStart" property? Placing it here I believe runs the code when the app first loads.

  • amyharkus86 Profile Picture
    726 on at

    @KeithAtherton same result. 

     

    When emailing the collection using ConCat i get the whole collection not just the filtered collection i wish to send. 

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

    Thanks. The email could be sent using the same filtered collection instead of the whole collection, so using the code you already have.

     

    Or, if you need the collection filtered ahead of time (which will have the same effect as above), a new collection can be created from the filtered collection ahead of time, either by App.OnStart (as mentioned by @galos), or the screen OnVisible event, or by another action such as a button click.


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

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

    I would expect a Concat() of the filtered collection to concatenate only the filtered collection items.

     

    Can you share the code which performs the Concat() and sends the email?


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

  • Verified answer
    amyharkus86 Profile Picture
    726 on at

    @KeithAtherton All sorted emailing with this code in the email body.

     

    Concat(CCRDCollection.AllItems,"<br>
     " &
     "<br> Date: " & Date &
     "<br> Start Time: " & StartTime &
     "<br> Finish Time: " & FinishTime &
     "<br> Lunch Break: " & LunchBreak &
    "<br> Hours Worked: " & HoursWorked &
    
    "<br> <br>"
     
     )

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard