Hi,
I would like to include in the people picker users that match some departments only but I'm unable to do so
I tried to use
Filter(Office365Users.SearchUser({searchTerm:PeoplePicker_3.SearchText}),!IsBlank(JobTitle)&&!IsBlank(Mail)&&!IsBlank(Department)&&
("AB Department" in Department ||
"BC Department" in Department ||
"XY Department" in Department
)
)
But no luck. Any idea what I'm doing wrong. It is working if I only include one department in the filter
Solved! Go to Solution.
I tried with this. It is working now Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),"AB" in Department || "CD" in Department || "DE" in Department || "FG" in Department)
Please see if this syntax works.
Filter(Office365Users.SearchUser({searchTerm:PeoplePicker_3.SearchText}),!IsBlank(JobTitle)&&!IsBlank(Mail)&&!IsBlank(Department)&&
Department in ["AB Department", "BC Department", "XY Department"]
)
Pat
To learn more about the Power Platform, follow me on Twitter or subscribe on YouTube.
It shows as invalid syntax
I tried it out successfully on my end. I must have keyed something in wrong. I made a button that created a collection with similar structure below
ClearCollect(colEmployees, Table({Name: "Joe", Title: "Manager", Department: "A"}, {Name: "Mary", Title: "Director", Department: "B"}, {Name: "Tom", Title: "Manager", Department: "C"}, {Name: "Joe", Title: "Manager", Department: "C"}))
And then Filtered it in a gallery.
Filter(colEmployees, !IsBlank(Name) && !IsBlank(Title) && Department in ["A", "B"])
Regards,
Pat
To learn more about the Power Platform, follow me on Twitter or subscribe on YouTube.
My data connection is to Office365Users and filtering the users using that. Not using a gallery
Any idea how to filter within my data source
I tried with this. It is working now Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),"AB" in Department || "CD" in Department || "DE" in Department || "FG" in Department)
Seem the issue was there was a spelling mistake when naming the department. That's why it was not working before. Thanks for the help @mahoneypat
User | Count |
---|---|
255 | |
106 | |
85 | |
51 | |
43 |