web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / DISTINCT not working w...
Power Apps
Answered

DISTINCT not working when datasource is a sharepoint list

(0) ShareShare
ReportReport
Posted on by 15

Hello,

 

I am attempting to get a distinct list of all grade levels from a sharepoint list that contains a book name and a grade level.  I want to bind this list to a dropdown, but for some reason the Distinct function indicates that it is returning a multiple column table instead of the single column table.  The code I used in the Items section of my dropdown was

 

Distinct(Notebooks,Grade)

And this generated a warning.   I tried creating a collection to store the results but what I is stored is a single table containing 3 columns including the type of data, id, and Grade level.  The table in the collection only contains a single Grade and no others.  Am I just using the distinct wrong?  is it not supposed to be used off of a sharepoint datasource?

 

Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @dwhittaker82,

     

    Is the Grade field a lookup type field in SharePoint list?

    If yes, then please take a try to modify the formula as below:

    Distinct(Notebooks,Grade.value)

    This would make the Distinct work without the blue remindings.

    The formula part of the Distinct requires Text or number format, while Lookup type from SharePoint list is record type.

    Distinct function in PowerApps

    If you have any further questions, please post back.

    Regards,

    Michael

  • Tom_Slosse Profile Picture
    1,430 on at

    Hey @dwhittaker82

     

     

    You could use a GroupBy function on Grade like so:

    GroupBy(Filter(<datasource>, <field_where_grade_is_placed> = Grade),"Grade","Grades")

    I hope this will help you a little further.

    https://powerapps.microsoft.com/en-us/tutorials/function-groupby/

    Please let me know if you tried this and how it turned out.

     

    Kind regards

     

     

    Tom

  • dwhittaker82 Profile Picture
    15 on at

    At one point grade was a lookup field,  Im attempting to make a simple order form for schools to allow them to order notebooks from our print shop.  Originally the grade field was a lookup field to a generic grade list.  This caused a few issues when I tried to save orders because powerapps expected a record when saving the data and my dropdowns were only suppliying a text value of the grade.  I attempted to fix this by combining the book and grade lists into one so now grade should just be a choice field on the notebook list, and the order form is just saving the combined grade, book, amount values as a text.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard