Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Overwriting records that match in Collection using LoadData

Hello Power Apps Community,

First of all, I am using this line of code to create a collection OnStart and fill it with my data:


ClearCollect(MeasurementLines; AddColumns('[dbo].[CRONUS Nederland BV$Measurement Lines]'; "showError"; false; "showWarning"; false; "userName"; ""; "DateTime"; ""; "OutgoingGoods"; "")



This collection is filtered on Line Type attribute and is then displayed in a Gallery with a text input.
OnChange of the Text Input will patch the selected item when entry is correct using this code:



Patch(MeasurementLines; ThisItem; {'Measured value': Value(MeasurementInput.Text)}; {showError: false}; {showWarning: false}; {userName: UserInformation.FullName}; {DateTime:Now()})


After the patch, in the same OnChange, I have put in this code:


SaveData(MeasurementLines; "SavedMeasurementLines")



When opening the application, I want to prioritize records from LoadData over collecting the items from the datasource. I want to end up with the records from LoadData (if not empty) and the rest of the records from the datasource, but all in the same collection called MeasurementLines.

Does anyone know how to implement this?



Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.


New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,354)