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

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
RandyHayes
Super User III
Super User III

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.
Check out my PowerApps Videos too!

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

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.
Check out my PowerApps Videos too!

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 

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.
Check out my PowerApps Videos too!

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!

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 

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (80,824)