I have a series of multi-select cascading combo boxes working as desired to populate a SharePoint list. Only thing I want to change is when the parent combo box is changed it currently completely clears the child combo box, I would like the child combobox to maintain the valid selections. What I mean by this is if in the parent "Direct" and "Indirect" are selected, then in the child "Alpha" and "Bravo" selected (linked to Direct) and "Charlie" and "Delta" (linked to Indirect) are also selected. If I go back to the parent combo and deselect "Indirect", I want "Alpha" and "Bravo" to remain.
Parent combo box: "comboType" is linked to choices field in Sharepoint list and items property is this;
Choices('Category Options'.'Direct/Indirect')
Child combo box: "comboCat" is linked to lookup column in Sharepoint list and items property is this;
Filter('Category Options', 'Direct/Indirect'.Value in comboType.SelectedItems.Value)
I have tried setting a variable in the OnChange of the parent and calling it within the DefaultSelectedItems of the child, any variation of this still completely clears the child.
Parent OnChange
Set(prevSelection, comboCat.Selected)
Child DefaultSelectedItems
If(!IsBlank(prevSelection), Filter(prevSelection, Value in Filter('Category Options', 'Direct/Indirect'.Value in comboType.SelectedItems.Value).Value), [])
Managed to solve my own query through trial and error, I share the solution here for anyone interested;
Parent combobox;
OnChange
ClearCollect(prevCat,Filter(prevCat, 'Direct/Indirect'.Value in comboType.SelectedItems.Value))
Child combobox;
OnChange
ClearCollect(prevCat,Self.SelectedItems)
DefaultSelectedItems
prevCat
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.