cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Spawn10
Helper II
Helper II

How do I use patch to update a current record?

In my Submit button, I am trying to perform a Patch to update the current item and I am doing this

Patch('My List', 
	First(Filter('My List',OpenItems.Selected.ID)), 
		{Status:varStatus}
		
		);

I am trying to use a variable to set my Status field. 

This is giving me an "The function Patch has some invalid arguments". What am I doing wrong here?

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Spawn10 

 

If you have a form control and need to patch the last item updated/added 

 

Patch('My List', 
	FormName.LastSubmit, 
		{Status:varStatus}
		
		);

 

If you need to patch a particular case use

 

Patch('My List', 
	Lookup('My List',ID = OpenItems.Selected.ID), 
		{Status:varStatus}
		
		);

 

--------------------------------------------------------------------------------
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.

View solution in original post

2 REPLIES 2
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Spawn10 

 

If you have a form control and need to patch the last item updated/added 

 

Patch('My List', 
	FormName.LastSubmit, 
		{Status:varStatus}
		
		);

 

If you need to patch a particular case use

 

Patch('My List', 
	Lookup('My List',ID = OpenItems.Selected.ID), 
		{Status:varStatus}
		
		);

 

--------------------------------------------------------------------------------
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.

View solution in original post

RezaDorrani 

Thank you so much for the help. It definitely answered my question, and got me going in the right direction

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,636)