-1

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

enter image description here

to add rows to OBNIST gallery. enter image description here

The OBNIST gallery is bound to TempRows collection

enter image description here

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

sugarakis
  • 117
  • 9
  • Are there any required or unique columns in the list? If yes, you will have to pass the correct values to those columns. Also, make sure you are passing correct data type to all columns. For e.g pass valid number to the "Number" type column in the SharePoint list. – Ganesh Sanap Aug 16 '23 at 13:37
  • @Ganesh , Yes I am passing the correct values but the issue still remains. I tried a number of different ways to accomplish this but I hit a brick wall, so I will try something different this time round and if successful, I will post my answer. Thank you – sugarakis Aug 16 '23 at 16:09

0 Answers0