Hi,
I’m new to Power Apps and I'd be really grateful for some help. I have a multi-select lookup column ('RelatedModels') in a Sharepoint list (‘Models’). I am pulling the items of this column into a combo box in a Power Apps gallery. The gallery’s DefaultSelectedItems are ‘ThisItem.RelatedModels.‘
I want to be able to update the combo box's selected items in the gallery, patch the items to a collection, which is a filtered version of my SP list, and finally patch the collection to my Models’ SharePoint list.
The OnSelect property of my button which is supposed to patch the updates to an existing item in my collection is:
ForAll(
RelatedModels.SelectedItems,
Collect(
colItemsToPatch,
{Id: ThisRecord.ID,
Value:ThisRecord.Title}
)
);
Patch(
RelcolGridData,
ThisItem,
{RelatedModels:colItemsToPatch});
Clear(colItemsToPatch);
This works fine on the first OnSelect – all the items appear in the relevant column of the RelcolGridData collection. However, if I make further changes to the same items in the gallery's combo box, the items disappear after I have selected
the button which triggers the above formula. When I click on the table in the relevant item of the RelcolGridData collection, it contains the correct number of records, but most of the records are blank.
I hope this makes sense.