Hi@dsab81,
Sorry for the late reply.
This time I decided to create a similar collection to test again.
Here is my collection named "Site Admin":
ClearCollect(
'Site Admins',
{
City: "d",
Supplier: "as",
'Site Name': "xxx"
},
{
City: "s",
Supplier: "sd",
'Site Name': "xxx"
},
{
City: "d",
Supplier: "ff",
'Site Name': "xx"
},
{
City: "d",
Supplier: "fd",
'Site Name': "xxx"
}
)
Set the OnCheck of the Checkbox1 as below:
Reset(ComboBox2);
Set(
Glob,
Distinct(
'Site Admins',
If(
NewComboBox.Selected.Value = "City",
City,
NewComboBox.Selected.Value = "Supplier",
Supplier,
NewComboBox.Selected.Value = "Site",
'Site Name'
)
)
);
Set the Items property of the Combo Box2 as below:
Sort(Distinct(
'Site Admins',
If(
NewComboBox.Selected.Value = "Supplier",
Supplier,
NewComboBox.Selected.Value = "City",
City,
NewComboBox.Selected.Value = "Site",
'Site Name'
)
),Result)
Set the OnChange property of the Combo Box2 as below:
Clear(SelectedPerson); // Add this formula
ForAll(
// Add this formula
'ComboBox2'.SelectedItems,
Collect(
SelectedPerson,
Filter(
'Site Admins',
If( // Modify formula here
NewComboBox.Selected.Value = "Supplier",
Supplier = Result,
NewComboBox.Selected.Value = "City",
City = Result,
NewComboBox.Selected.Value = "Site",
'Site Name' = Result
)
)
)
);
If((CountRows(SelectedPerson)+CountRows(NewComboBox.SelectedItems)+CountRows('ComboBox2'.SelectedItems)) >500,UpdateContext({PopUpCount: true}))
Set the DefaultSelectedItems property of the Combo Box2 as below:
If(Checkbox1.Value=true,Glob)
Here is my test result, everything works great, please check as above.
Regards,
Qi