Hallo,
i have a gallery which i want to filter based on a combo box that allows multiple values.
Items property in the combo box:
Sort(Distinct(Ungroup(colTargetGoals, "Assignee"), DisplayName), Result,Ascending)
Items in gallery returns error when i type the following:
Filter(
colTargetGoals,
And(
Or(IsBlank(AssignToCB.SelectedItems),
IsEmpty(AssignToCB.SelectedItems),
Assignee in AssignToCB.Selected.Result
),
TextInput1_2.Text in Title
)
)
"""Cannot use table values in this context..."""
Any ideas?
Solved! Go to Solution.
Hi @marial16 ,
From the look of it, the Assignee column is a multiselect column and that's why it can't be used in the context of the "in" operator as that will only accept a single value, not a table as is returned in this case.
In case your combobox is a single select, you might try reversing the in statement:
Filter(
colTargetGoals,
And(
Or(IsBlank(AssignToCB.SelectedItems),
IsEmpty(AssignToCB.SelectedItems),
AssignToCB.Selected.Result in Assignee
),
TextInput1_2.Text in Title
)
)
https://docs.microsoft.com/en-us/power-platform/power-fx/reference/operators
Hi @marial16 ,
From the look of it, the Assignee column is a multiselect column and that's why it can't be used in the context of the "in" operator as that will only accept a single value, not a table as is returned in this case.
In case your combobox is a single select, you might try reversing the in statement:
Filter(
colTargetGoals,
And(
Or(IsBlank(AssignToCB.SelectedItems),
IsEmpty(AssignToCB.SelectedItems),
AssignToCB.Selected.Result in Assignee
),
TextInput1_2.Text in Title
)
)
https://docs.microsoft.com/en-us/power-platform/power-fx/reference/operators
Hallo,
I tried this with the allow multiple selections of the combobox to 'Οn'
Below code seems to work
Filter(
colTargetGoals,
And(
Or(IsBlank(AssignToCB.SelectedItems),
IsEmpty(AssignToCB.SelectedItems),
AssignToCB.Selected.Result in Assignee.DisplayName
),
TextInput1_2.Text in Title
)
)
User | Count |
---|---|
248 | |
105 | |
82 | |
51 | |
43 |