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 / Collections with disti...
Power Apps
Suggested Answer

Collections with distinct NOT working

(1) ShareShare
ReportReport
Posted on by 22
I am trying to create a collection to hold all the distinct values in a column called Status in a table called "AWP1.workordersform"
In the App's "OnStart" formula I added:
"
ClearCollect(cllStatus,{Result:"All"});
Collect(cllStatus,Distinct('AWP1.workordersform',status))
"
Then in a dropdown called "DropdownCanvas3" I updated the "Items" formula to be just "cllStatus"
 
The correct Status values are "Cancelled" etc.  The drop down box is showing just numbers which have no meaning to me.  However when I try selecting on of the values of this list of wacky numbers it appears to correctly select the corresponding status values and show only the rows on the table that are cancelled.

This PowerApps is horrible.  So many examples like this that should work, don't work and its not obvious how to fix and there is notthing but out-dated information that does not help me fix anything, I just have to try a million times until days later you stumble on the stupidity that fixes the issue. BTW: the above is pulled directly from a YouTube video from 2022 which is now total crap.
Categories:
  • Suggested answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at
    Hello,

    I have tested your use case in my environment.
     
    Have you tried setting the value of the dropdown to the correct field?
    When I add the dropdown, I also receive numerical values.
     
    But when I select the correct field in the Fields property I get the correct value:
     
    End result:
     
    Hope this helps.
  • Suggested answer
    SaiRT14 Profile Picture
    1,992 Super User 2025 Season 1 on at
     
    When using Distinct() with a choice column, Power Apps often defaults to returning the numerical ID of the choice option rather than the display text. To avoid this, explicitly reference the Value property of the Status field. Modify your OnStart formula
    ClearCollect(cllStatus, {Result: "All"});
    Collect(cllStatus, Distinct('AWP1.workordersform', status.Value))
     
    Use cllStatus Directly in the Dropdown -your dropdown’s Items property to: -  cllStatus
  • WarrenBelz Profile Picture
    156,754 Most Valuable Professional on at
    Some guidance here - one issue is that the output of Distinct is .Value, not .Result. You did not state your data source, however if status was a Text field in a SharePoint List, you would do it all with.
    ClearCollect(
       cllStatus,
       Table(
          {Value: "All"},
          Distinct(
             'AWP1.workordersform',
             status
          )
       )
    )
    Also try with a Classic Control - Modern Controls are still in Preview and are really not production-ready presently.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard