cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PeterDonohue 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
PeterDonohue 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
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.
PeterDonohue 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

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.
PeterDonohue 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 

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.
gavinleung 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!

PeterDonohue 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 

Share
Frequent Visitor

Re: Distinct People Dropdown / Gallery

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

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,465)