web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching updated colle...
Power Apps
Unanswered

Patching updated collection data into Excel Datasource

(1) ShareShare
ReportReport
Posted on by 2

Hello,

I'm building an app wherein there is flow of stakeholder actions and using gallery to navigate to each screen for that.

In Context: Stakeholder1 screen. Buttons on S1 screen: Add for Location, Save.

When I navigate to the screen for S1, it has a gallery ( items created using Screen OnVisible = ClearCollect(colItemtoUpdate, Filter(Datasource, request id = varRequestId)

I should be able to add new rows(populate new rows in the collection by clicking Add for Location)/edit current rows and patch it back to the datasource.

The row added in collection has 4 columns already populated from that button OnClick and 1 item is to be updated manually.
When I populate the last column items(it is updated in the collection using onchange/updateif functions)

Till here, all details are getting updated to the collection realtime as checked. The problem is when I patch this collection by clicking Save button, it patches to new rows everytime.

I want to patch and update records according to the datasource columns and rows.

For eg. if there are 4 locations, I select 1 location and onclick Add for Location it gives me x rows in collection.
I add the final column input with manual inputs and click on Save and it should patch data to the excel in a new row only if the rows don't exist. If the row exists(saved earlier) then it should update the same rows.

Whenever I am patching back to datasource it is not updating the existing rows, tried LookUp(Datasource, UID=ThisRecord.UID) but this fetches no input as ThisRecord is blank.

All I want is in this COLLECTION, whenever I make edits in the gallery, it should update the existing rows/add new rows if not found on clicking Save



Categories:
I have the same question (0)
  • NewFolklore Profile Picture
    2 on at

    For reference, the Save button OnClick is having function:

    Patch(Datasource, ShowColumns(collectionName, 'Columname1', 'Columname2', 'Columname3', 'Columname4'))

    This works when I am adding new rows but when I navigate back to previous screen and come back it does show already existing items in gallery but this time when I update previously existing items/make changes. It adds to a new row altogether.

    If 2 rows are there and I save, new rows are created. When I revisit the same request, and add 4 more rows based on location, it populates in the collection and updates all data in the collection. At the time of patching to datasource, it adds 6 rows now instead of 4 and does not update existing rows if i made changes to previously added rows.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard