cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dauchnie1
Level: Powered On

Powerapps Patch command not working - Share point not updating

I am stuck at the syntax for this - I have a large SharePoint List using multiple Powerapps edit forms to update the list

 

Here is my syntax- Patch('Datasource',Form.Updates,Form2.Updates,Form3.Updates,Form4.Updates,Form5.Updates,Form6.Updates,Form7.Updates,Form8.Updates)

 

It is triggered by clicking a submit button - I get no errors but it does not show any data in SharePoint so the update is not working

4 REPLIES 4
Community Support Team
Community Support Team

Re: Powerapps Patch command not working - Share point not updating

Hi @dauchnie1,

What you would like to schieve by using the patch function?

To update or edit the corresponding records, we need a based record parameter in the formula:

Patch (Table, BaseRecord, ChangeRecord)

Form.updates could be used to refer to the data when the form is in edit mode, which should be treated as the ChangeRecord parameter.

To make the Patch work, you need to specify the corresponding record, using lookup function, or first(Filter()) fucntion.

And, if you would like to create new record, use the Defaults(Table) as the second parameter.

For example:

To create new record under Testing List, the formula should be:

Patch('Testing List', defaults('Testing list'), {Title:"Testing", and the Other Fields})

To change the first record, the formula should be:

Patch('Testing List', first('Testing list'), {Title:"Testing1", and the Other Fields})

To change a special record, the formula should be:

Patch('Testing List', first(filter('Testing list', Title="Testing")), {Title:"Testing2", and the Other Fields})

Function reference:

Patch function in PowerApps

If you need any further help on this, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dauchnie1
Level: Powered On

Re: Powerapps Patch command not working - Share point not updating

What I am actually trying to do is the following

 

I have a Sharepoint list Datascoure called Members with numerous columns - for example - First Name, Last Name, Membership Number, Address, Postcode, Phone Number, Email address.

 

Essentially as the list has so many columns I wish to split the forms over mutiple Powerapps screens as opposed to just having the user scroll down

 

So

Screen1 woudl have Form1 with First Name, Last Name, and Membership Number - butoon to navigate to Screen2

Screen2 Would have Form2 with  Address, Postcode, Phone Number and Email address. - button to submit record

 

So when i click the submit button it runs the syntax for Patch

 

So I thought the code would be ('Members',Form1.Updates,Form2.UpdatesUpdates)

 

The same forms will be used with either a Newform (to add new record) or Editform command (edit existing)

 

Can you advise?

 

 

dauchnie1
Level: Powered On

Re: Powerapps Patch command not working - Share point not updating

I am still seekign assistance with this issue

Community Support Team
Community Support Team

Re: Powerapps Patch command not working - Share point not updating

Hi @dauchnie1,

 

The formula would change depends on the formmode.

If Form.Mode=New

Then the patch function should be:

Patch(Datasource. 
          defaults(datasource), 
           form1.Updates,
           form2.updates, 
           form3.updates
      )

In order to have this formula work, every form record should contain the required value.

For example the Title field is required in SharePoint list, and if we would like to create a new item, then every record of the form.updates should contain the Title field (which means this field should be visible under every form control);

If form.Mode=Edit,

And the record is choosen from the Gallery, then the formula should be:

Patch(Datasource. 
          Gallery.selected, 
          form1.Updates,
          form2.updates,
          form3.updates
  )

 

So under the final submit button, the OnSelect property should be:

If(Form1.Mode=New,

   Patch(Datasource. 
          defaults(datasource), 
           form1.Updates,
           form2.updates, 
           form3.updates
         ),

   Patch(Datasource. 
          Gallery.selected, 
          form1.Updates,
          form2.updates,
          form3.updates
        )
)

For the other propery of the form control, please check the following article and change it properly:

Edit form and Display form controls in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 295 members 5,113 guests
Please welcome our newest community members: