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 / 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

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 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard