Forum Discussion

RenPNW's avatar
RenPNW
Copper Contributor
Apr 07, 2024

How do I submit data to SharePoint list using Power Apps form

I have created a custom form for my SharePoint list to allow users to submit on three different tabs using the same form, Form Name = Flight Info, and my List is named GOS Daily Log v24.

 

On the SharepointIntegration page I have entered these formulas with no success:

 

OnSave = SubmitForm('FlightInfo') this formula does nothing when I use the Default Save on Form, does not post to List and does not clear form

OnSave= SubmitForm('FlightInfo');ResetForm('FlightInfo') -this formula clears the form but does not post to the List.

On trying to call up a record in the List to edit, the Form comes up blank and in the center of the form it reads "Getting your data..." and does nothing more.

OnEdit - fx = Set(varTabSelected,1);EditForm('FlightInfo')

 

I am also receiving this error on Submit - Network error when using the Patch function. The requested operation is invalid.

Do I have to reference the List name in the formula to get it to post to the List, if so how would that formula look?

 

Any help would be greatly appreciated.

 

Ren

 

The data does not

  • BarryGoblon's avatar
    BarryGoblon
    Iron Contributor

    RenPNW First, ensure you have created a data source in Power Apps that connects to your "GOS Daily Log v24" SharePoint list. Then, in your form's OnStart property, you'll want to create a collection to hold the form data and populate it with the default values from the list using the Defaults function. Next, set the form's DataSource property to this collection.

     

    This will bind the form controls to the collection, allowing users to input data. When it comes to submitting the form, you'll use the Patch function in the OnSuccess property. The Patch function will update or create a new item in the SharePoint list based on the data in your collection. Specifically, the Patch function takes three arguments: the data source (your SharePoint list), the item to update (or Defaults for a new item), and the collection holding the form data. After a successful submission, you can clear the form data by repopulating the collection with the default values from the list. If you need to edit an existing item, you'll retrieve the item's data from the SharePoint list in the OnEdit property using the LookUp function.

     

    This function takes the data source and the identifier of the item you want to edit (such as the ID column) as arguments. The retrieved data will then populate the form for editing. Throughout this process, I'll ensure proper error handling is in place, particularly for the "Network error when using the Patch function" issue, which may be due to permission restrictions or other factors.

Resources