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 / Putting table records ...
Power Apps
Unanswered

Putting table records into a collection

(0) ShareShare
ReportReport
Posted on by 8

Hello all,

 

I am trying to filter a table an put the results into a collection like:

 

Collect(CollectionName, Filter(TableName, criteria))

 

However the resulting collection table only contains the ids of the results returned, not the records themselves.  Looking at the documentation here: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-clear-collect-clearcollect I understand you can put 'records' into a table by using the correct syntax, but can you not do this with table records returned by a filter?  Is this a limitation of the Collect function or am I doing something wrong?  

 

Thank you in advance to everyone who has a look.

Aaron

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @avankosky This could be due to the "Explicit Column Selection" Setting.

    CNT_0-1682029001143.png

     

    You could disable this setting (but that's not recommended as this is in Preview and soon will become part of the core and therefore non-optional). But you could just turn it off and see if this is the source of the problem.

     

    A workaround for this would be to wrap the Filter with ShowColumns.

    ShowColumns(Filter(.......), "Column1", Column2",.........)

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • avankosky Profile Picture
    8 on at

    Thank you for the reply.  I understand your suggestion about wrapping the Filter in a show columns, but using this method I am just building a table in the collection using the properties of the objects returned by the filter, not putting the records returned by the filter into a table.

     

    I am trying to get this:

    CollectionTable

    Record1
    Record2

     

    Your suggestion gives me this:

    NamePriceDescription
    Record1.NameRecord1.PriceRecord1.Description
    Record2.NameRecord2.PriceRecord2.Description

     

    Is what I am trying to get in the first table possible?  Can I put records retrieved from a filter (or lookup or search) into a collection as the full records themselves without having to recreate their structure in the collection table?

     

    The reason I ask this that that further along in my app workflow I need to filter a different table based on an object related to the records in the first table like Record1.RelatedObject.Property.  I have an idea for a workaround, but it would just be easier if I had access to the first subset of records.  

     

    This is my first crack at Power apps coming from the world of Object relational mapping and dotted notations.  So I am trying to wrap my head around the object hierarchy limitations.

     

    Thank you again to the community for their assistance.

    Aaron

  • catra_does_pw Profile Picture
    33 on at

    Hi Aaron, I know it may be a little too late, but I think I have a solution 

    I have a list that has a column type person  

    this code 

    ClearCollect(RecordCollection, ForAll('Microsoft_List' As MyItem, {Records: MyItem.column_Person.));

    stores the different records as a table 
    try it and tell me if it works for 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 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard