cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marial16
Post Partisan
Post Partisan

Filter gallery by person or group combobox

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?

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

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



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

2 REPLIES 2
BCBuizer
Super User
Super User

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



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

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
)
)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,967)