cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Updating item in powerapps creating a new one in sharepoint list

I have a survey which has 15 screens and when i try to update an existing survey item in powerapps, its creating a new item in sharepoint list, let me know what is missing in the below submit button formular

 

 

Untitled.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Updating item in powerapps creating a new one in sharepoint list

The second parameter of Patch() determines if it is going update an item or create a new one. In your formula you are using Defaults() which tells Patch to create a new item. If you want patch to update an existing record you need to pass it the record it needs to update instead of Defaults().

 

For example: Patch('Data Source', BrowseGallery1.Selected, { Flavor: “Strawberry” })

 

The Item property of one of your edit forms should show you the base record.

 

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.
4 REPLIES 4
Super User
Super User

Re: Updating item in powerapps creating a new one in sharepoint list

The second parameter of Patch() determines if it is going update an item or create a new one. In your formula you are using Defaults() which tells Patch to create a new item. If you want patch to update an existing record you need to pass it the record it needs to update instead of Defaults().

 

For example: Patch('Data Source', BrowseGallery1.Selected, { Flavor: “Strawberry” })

 

The Item property of one of your edit forms should show you the base record.

 

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.
Anonymous
Not applicable

Re: Updating item in powerapps creating a new one in sharepoint list

I have added it in my submit but its not creating an item now, do i want to do if else for form mode and add the shown formula inside the if condition?

 

Untitled.png

 

Super User
Super User

Re: Updating item in powerapps creating a new one in sharepoint list

Since the Patch formula is different for Update vs New you will want an If statement to determine which Patch formula to run.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.
Anonymous
Not applicable

Re: Updating item in powerapps creating a new one in sharepoint list

That works!, thank you for your help