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

SharePoint List Update or Patch Value

I am building an in-house inventory app that captures what items are being checkout in inventory.  So far I have 2 Sharepoint List:

Equipment - List all of the Equipment in inventory

Assignment - List all of the Equipment that have been checked out

 

On the Detail Screen of Assignment, I want to update the Status in the Equipment List from available to assigned and vice versa when it is checked back in. I cannot seem to get my Patch Formula to work out the way I want.  

 

So on the Assignement Page (See attachment), it has the list of Equipment Available for Checkout.  Once I save the assignment I want change the status of the selected equipment from avaiable to assign.  What Should I use in the PAtch Formula so that I am assigning the correct equipment with the correct status.

 

 

 

 

2 REPLIES 2
v-micsh-msft
Community Support
Community Support

Hi @Anonymous,

 

How do you work with the Assignment list here, which control is used, and the related information about the data field?

 

If here you are using the EditForm control, then we could take use of the OnSuccess property of the form control to implement the Patch function.

Assuming the patch will only work on CheckOut and when Editing records, the formula under the OnSuccess property of the form control should be:

If(Value(Form1.Mode)=0 && CheckOut=true, patch(Equipment, ID=Form1.LastSubmit.Equipment.ID, {Status: "Available"}),true)

The formula above assumes you are using Form control, and the Status under Equipment list is a text field.

 

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.
Anonymous
Not applicable

The Equipment List contains the status (available/Checked Out).  The Assignment Form contains everything from the Assignment SharePoint List except the Equipment ID, which is being pulled from the Equipment List.

 

Could you possibly convert the formula to say something like "If the form is submitted, then update the Equipment List with the this ID to status checkout"?

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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 (18,814)