cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jebediah
Frequent Visitor

Trying to filter a dropdown list filled with people name into a Gallery

Hey guys,

 

As the title states, I am trying to get a dropdown list filled with people name to load different things into a Gallery like this exercise (https://youtu.be/kLGglidmPxg?t=224) is doing. I am working from a SharePoint list, and initially had no problem to generate all the projects, and now I would like to be able to sort all of them by Director.

 

Right now, all the names are generating in the dropdownlist list with this code in the Items property : 

 

Distinct(
AddColumns(
Projects,
"Director",
'Project Director'.DisplayName
),
Director

 

Then here is my problem, I go to my Gallery and in the Items property I tried to use this code without any luck, nothing will generated in the Gallery

Filter(Projects, 'Project Director' = DropdownDirector.Selected.'Project Director')

 

I know the column name are right, they are a person field loaded into a SharePoint list.

 

Thanks for your help, it is much appreciated.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Jebediah ,

You cannot filter directly by complex field types (which is a one of the good reasons for not using them - a have a blog that may interest you)

Filter(
   AddColumns(   
      Projects, 
      "Director",     
      'Project Director'.DisplayName
   ),
   Director = DropdownDirector.Selected.'Project Director'
)

 This will only work up to list numbers of your Delegation limit (500-2,000)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

@Jebediah ,

I could not agree more - that code however should work as it is referring to the correct field value.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Jebediah ,

You cannot filter directly by complex field types (which is a one of the good reasons for not using them - a have a blog that may interest you)

Filter(
   AddColumns(   
      Projects, 
      "Director",     
      'Project Director'.DisplayName
   ),
   Director = DropdownDirector.Selected.'Project Director'
)

 This will only work up to list numbers of your Delegation limit (500-2,000)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi Warren,

 

Once again thanks for your help, I have about 10 names in that list. I have tried the code you have provided me in the Gallery Items Property and I wasn't able to generate anything on it.

 

 

Jebediah
Frequent Visitor

I'm starting to think change that SharePoint column to a text field might sure be the best option. 

@Jebediah ,

I could not agree more - that code however should work as it is referring to the correct field value.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,165)