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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (90,506)