Hi all,
We have a Loan System that allows us to loan laptops out to students and keep track of who has which device. This runs off of multiple SharePoint lists - Loans, Loan Assets and Users.
Loans makes use of multiple lookup columns to both Loan Assets and Users to get information about who loaned a device and which device they loaned.
We have it all working so that we can enter loans via a form, view them through a Gallery, and return them via another form.
- When a loan is returned, the ReturnDate is set to Now() in Loans, and the Availability of an asset is set to 0 in Loan Assets.
- This prevents us from loaning out the same device multiple times.
We're finding that at the end of the day when we get ten loans back at once, it would be good to be able to return them all quickly. To go about this, I added a checkbox to the Gallery that adds the selected item to a collection - SelectedItems. There is a button that has the following OnSelect value:
ForAll(SelectedItems As myItem,
Patch(Loans,
LookUp(Loans, ID = myItem.ID),
{
'Date Returned': Now()}
)
);
Patch('Loan Assets',
LookUp('Loan Assets', Tag = LoanTagField.Selected.Value),
{
Available: 0}
);
Clear(SelectedItems);
This works for returning one item, but it doesn't iterate over all items in the Collection.
How can I get this to work for all items in SelectedItems?

Report
All responses (
Answers (