Hi
I have a PowerApp that is an Inventory system in which you can 'check out' items and then you are able to 'Check in' the notes back and works off 2 SharePoint lists.
I have written a patch function which allows the user to check in less items than originally checked out.
With(
{
SharedItemToPatch: LookUp(
Notes,
ID = varRecord3.ItemBorrowed
)
},
Patch(
Notes,
SharedItemToPatch,
{ TotalCheckedIn: Dropdown3.Selected.Value,
TotalCheckedOut: SharedItemToPatch.TotalCheckedOut - (varRecord3.TotalCheckedOut-Dropdown3.Selected.Value)
}
)
);
Patch(
'Note List log',
varRecord3,
{
Status: "Returned",
DateActualReturned: Today(),
TotalCheckedOut: (varRecord3.TotalCheckedOut-Dropdown3.Selected.Value),
TotalCheckedIn: Dropdown3.Selected.Value
}
);
The issue I am having is that when I check in the 2nd Patch function works perfectly and the Check Out column decreases but I can not replicate this on the first function. It never decreases properly.
Can anyone help as this is driving me insane
Thanks