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 / Unusual Collect functi...
Power Apps
Unanswered

Unusual Collect function behavior

(1) ShareShare
ReportReport
Posted on by 2

Hi everyone.

I have a problem with Collect function. Basically application is collecting user's weekly reports. User enters the data and adds it in the collection which is the same structure (same column names) as the backing table (Excel). After entering all data, users hit submit button which after all saves collection to excel table - Collect(excel-table, collection). It works perfectly, without problems. But I add functionality that user can overwrite collection with data from excel-table from previous week, so that user doesn't have to much efforts in populating new week reports. The data copying from excel-table to collection is done without problems. User continue to update data in collection and when it hit submit again as previously stated - Collect(excel-table, collection) it doesn't store it in excel-table. One more scenario: user pulls data from previous week, update that record in collection and then add another record; when it hit submit it only store that new added record from collection, instead both records (I consider copied data from excel-table  to collection as new record to ad when the Collect(excel-table, collection) is called).

Am I missing something with the kind I am using Collect() or there is a bug in back end with Collect function?

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @powerNewbie 

     

    We do not think there is a bug here in this case.

     

    We think it could be because you are attempting to "update" a record using the Collect function.

    We think this is the case due to your own wording. You seem to expect a record to be updated when using the Collect function. However the Collect function is not for updating existing records, but only for creating new records.




    That's also probably why you may be experiencing only seeing "Created / brand new" records using Collect.

     

    You would want to use the Update function to update a record.

     

    From:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-update-updateif

     

    Use the Update function to replace an entire record in a data source. In contrast, the UpdateIf and the Patch functions modify one or more values in a record, leaving the other values alone.

     

    From:
    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearcollect

    Collect

    The Collect function adds records to a data source. The items to be added can be:

    • A single value: The value is placed in the Value field of a new record. All other properties are left blank.
    • A record: Each named property is placed in the corresponding property of a new record. All other properties are left blank.
    • A table: Each record of the table is added as a separate record of the data source as described above. The table is not added as a nested table to a record. To accomplish this, wrap the table in a record first.

    When used with a collection, additional columns will be created as needed. The columns for other data sources are fixed by the data source and new columns cannot be added.

     

     

     

     

     

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard