What I want to accomplish is to populate a Power Apps gallery with rows of data, stored in a temporary collection and when user clicks the Save button to save the data from the temporary collection to a SharePoint List, OB_Data_NIST.
In Power Apps I have a form (OA) and a gallery (OBNIST) inside that form. I am also using a temporary collection variable, TempRows
to add rows to OBNIST gallery.
The OBNIST gallery is bound to TempRows collection
When I click the Add Row button a new empty row is added in OBNIST gallery. This is the code executed
Collect(
TempRows,
{
OBN_ServiceName: OBNIST.Selected.OBN_ServiceName.Selected.Value,
OBN_ProductName: OBNIST.Selected.OBN_ProductName.Selected.Value,
OBN_Link: OBNIST.Selected.OBN_Link.Text
}
);
Users can add data in the OBNIST rows. When I click the Save button the following code is executed (SavedOB_ID is calculated before hand as the next ID column value)
ForAll(
TempRows,
Patch(
OB_Data_NIST,
Defaults(OB_Data_NIST),
{
OBN_OB_ID: SavedOB_ID,
Title: OBTitle.Text,
OBN_ServiceName: ThisRecord.OBN_ServiceName,
OBN_ProductName: ThisRecord.OBN_ProductName,
OBN_Link: ThisRecord.OBN_Link
}
)
);
I am trying to read and save all the TempRows into the SharePoint List, OB_Data_NIST. However, I get back an error:
Network error when using Patch function: The requested operation is invalid.
Can someone please let me know what I am doing wrong? Thank you