cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Distinct People Dropdown / Gallery

I know this has been asked in a mutlitide of ways, but I'm at a complete loss. I have a sharepoint list with a people picker field. All I want to do is populate a dropdown with distinct people values from that list. I have tried

 

Distinct('Recruitment Test',Hiring_Manager)

and I keep getting the nested tables error. I do not want to use the Office365Users connecotr for search if possible

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: Distinct People Dropdown / Gallery

The data type is Person - Single Values only. I tried .DisplayName but it now shows up blank. I added the following to get it to work

 

Sort(Distinct('Recruitment Test',Hiring_Manager.DisplayName),Result,Ascending)

Wow, what a long way to go 🙂

 

View solution in original post

8 REPLIES 8
Highlighted
Super User
Super User

Re: Distinct People Dropdown / Gallery

What is the data type of the Hiring_Manager column?

If it's a people field, try using Hiring_Manager.DisplayName

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Advocate II
Advocate II

Re: Distinct People Dropdown / Gallery

The data type is Person - Single Values only. I tried .DisplayName but it now shows up blank. I added the following to get it to work

 

Sort(Distinct('Recruitment Test',Hiring_Manager.DisplayName),Result,Ascending)

Wow, what a long way to go 🙂

 

View solution in original post

Highlighted
Super User
Super User

Re: Distinct People Dropdown / Gallery

Not so long a trip...here's why.  If you read the docs on Distinct, there is one little bit that gets missed:

The Distinct function evaluates a formula across each record of a table. Distinct returns a one-column table that contains the results, with duplicate values removed.

What isn't clear is what exactly that means.  In thos case it means that you are going to get a table back that has one column in it and that column is named "Results".

So, in your sort case, you are sorting the table returned from distinct on the Result column (which is the only one).

In reality, it's probably what you wanted to start with....as sorted list.

However, you can get to the same results by making your Items on the dropdown be Distinct(DataSource, ColumnName).Result or setting the Value to display in the properties to Result.

 

Glad you got to the results you needed (slight pun intended) Smiley LOL

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Advocate II
Advocate II

Re: Distinct People Dropdown / Gallery

I tried but got an error - The property cannot consume the type of Tables.... 🙂

Distinct('Recruitment Test',Hiring_Manager).Result

Adding .DisplayName removes the error but the list is not populated 

Highlighted
Super User
Super User

Re: Distinct People Dropdown / Gallery

Strange indeed.  We use that (almost) exact syntax on drop downs for distinct name lists from sharepoint.

Echoing one of your earlier statements "I do not want to use the Office365Users connecotr for search if possible" - totally agree.  Although it is a great source of information, it has a high performance cost.


 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Resolver I
Resolver I

Re: Distinct People Dropdown / Gallery

Hi @PeterDonohue , in my end it is not working. 

 

I'm having a dropdown, and I'd like to list all the people from the Sharepoint list column (type: Person). I set the the "Items" property of the dropdown as this:

 

Sort(Distinct('Standard Work Plan', 'Assigned To'.DisplayName), Result,Ascending)

 

And set the "Value" property of the dropdown as "Result". 

 

It returns nothing ... 

 

Can you share how it can be done in your end ? Thanks!

Highlighted
Advocate II
Advocate II

Re: Distinct People Dropdown / Gallery

Hey @gavinleung I'm not sure about the Value part. I just put the formula 

Sort(Distinct('Recruitment Test',Hiring_Manager.DisplayName),Result,Ascending)

in the items property so I don't know sorry. If you post some screenshots I'm sure we can figure it out 

Highlighted
Frequent Visitor

Re: Distinct People Dropdown / Gallery

No me funciono dicha solución, existe alguna otra para validarla.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,365)