I am trying to copy a set of records filtered from a SharePoint list to a collection so that they can be edited and then saved as new records in the same SharePoint list. My current solution is not creating copies of the original records, but instead sending the records to the collection. Then when I edit it and save, it's saving over the original records, not creating new ones.
My code to filter the SharePoint list and copy it to the collection is:
ClearCollect(
LineItem,
Filter(
tblLine,
Value(Title) = ID
)
);
where "LineItem" is the collection I am copying to, "tblLine" is the SharePoint list I am copying from, "Title" is the column in the SharePoint list I am filtering, and ID is a variable holding the value I am filtering the column by.
I am then displaying the collection in a gallery so that each of the records can be edited individually. Then my code to save the collection to the SharePoint list is:
Patch(
tblLine,
LineItem
);
This, however, just updates the original records in the SharePoint list; it does not create new records.
I have tried replacing "LineItem", with "Defaults(LineItem)". In that case, the original record is not updated, but there are no new records created either.
Any help is greatly appreciated.