cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeterDonohue
Level: Powered On

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
Level: Powered On

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

7 REPLIES 7
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
Level: Powered On

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
Level: Powered On

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
Level 8

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
Level: Powered On

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 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,646)