I'm facing several issues with multi-select combo boxes and would like to seek advice.
Let me start with the lookup columns. There are two columns in my main SharePoint list, ManufacturerCode and ProductCode:


There is also a lookup column Countries within the Manufacturer Product Mapping list, which is similarly set up as the lookup column Country in my main SharePoint list:

I have three combo boxes in a PowerApps form linked to the respective lookup columns in my main list; Country, ManufacturerOrg and ProdCode:
ComboBox1 DatacardValue20
Choices([@ItemList].Country)
ComboBox2 DatacardValue21
Items = ShowColumns(
Filter('Manufacturer Product Mapping',Country.Id = DataCardValue20.Selected.Id
),
"Title",
"ID"
)
OnChange = Clear(ManufacturerCollection);
ForAll(
DataCardValue20.SelectedItems As MOrgSel,
Collect(
ManufacturerCollection,
ShowColumns(
Filter(
'Manufacturer Product Mapping',
MOrgSel.Value in Title
),
"ID",
"ProdCode",
"Title"
)
)
);
ComboBox3 DatacardValue22
Items = ShowColumns(
Filter('Manufacturer Product Mapping',Title = DataCardValue21.Selected.Value
),
"ID",
"Title",
"ProdCode"
)
Here are a few challenges I'm currently facing:
1. How can I use Distinct within ShowColumns, i.e. in ComboBox3 ?
ShowColumns(
Filter('Manufacturer Product Mapping',Title = DataCardValue21.Selected.Value
),
"ID",
"Title",
"ProdCode"
)
2. I would like to automatically display the matching ProdCode in ComboBox3 whenever a ManufacturerOrg value is selected. Tried this code but only a single ProdCode (i.e. last selected item) is displayed when multiple ManufacturerOrg values are selected:
DefaultSelectedItems = RenameColumns(Distinct(Filter('Manufacturer Product Mapping',Title in DataCardValue21.Selected.Title),ProdCode),"Result","Value")
3. All of this sort of works, but I am only able to store a single selected item from ComboBox2 and ComboBox3 in my main SharePoint list. How can I make sure all the selected items are returned to SharePoint when the form is submitted?
Not sure if I'm moving in the right direction here, any advice would be very much appreciated.