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 / Show new and old recor...
Power Apps
Answered

Show new and old records in collection

(0) ShareShare
ReportReport
Posted on by 986

Hi,
I have tried creating a TimeSheet functionality in Power Apps, where in user can enter their work mode for the week (WFH: Work from Home and WFO: Work from Office). So I am able to calculate the total WFH and WFO (using Switch). I have also given a button to save and view the details submitted, this works ok when there is one record but when I tried to enter working mode for other user then the previous data which was saved was not present (override) and only new the record was shown

Sidhant_02_0-1678696576823.png
So now if a new record is entered then the previous record is replaced by new record which not what I want.
Example: Now the new record entered is: Sam WFH WFH WFH WFH WFH  WFO: 0 WFH: 5 <- This record will shown on the above screen. Instead I want to show all the records (old and new records on the same screen and not only records)

The above screen is named TimeSheet Saved Screen_2 (where in I am displaying all the saved records). All these records are collected in a gallery named TimeSheetLines1

The page where the user can enter the data (Timesheet)

Sidhant_02_1-1678696762702.png


On Save Button:

Sidhant_02_2-1678696803733.png

Used a collection to store the data entered by user.

The screen to display the records:

Sidhant_02_3-1678697030610.png


Please let me know how to get the expected result in this.

Regards,
Sidhant

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

    I was able to solve this issue, previously I was clearing the collection after clicking on the submit button. It was working but the problem was if a user navigates back to the Timesheet screen and enters any new records then only the new records were being saved and the old records were overwritten.
    So to avoid this instead of ClearCollect(Gallery_Name), I used Reset() while saving the records, so now I am able to save my new records and get the old records as well. 
    I referred to Shane Young's video on Power Apps Reset Gallery:
    Reference 

    Old_NewRecords_SavedInGallery_UsingReset.PNG
    Old_NewRecords_SavedInGallery.PNG

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
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard