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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

Sort of distinct

(0) ShareShare
ReportReport
Posted on by 347

I have a drop down which displays a SP List person column based upon the user type in another drop down (admin, owner etc.).  The problem is that despite no errors,  then sort makes no difference. 

 

Can anyone advise?

 Dropdown1.Selected.Value = "Owner",
 Sort(ForAll(Distinct(
 'SP Register'.'Owner',
 { 
 '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", 
 DisplayName:'Owner'.DisplayName,
 Claims:'Owner'.Claims, 
 Email:'Owner'.Email
 }
 ),Result), Ascending)

 

Categories:
I have the same question (0)
  • v-albai-msft Profile Picture
    on at

    Hi @Coopedup ,

    How do you get the user type? What is the returned data type from your another dropdown? (Is the second dropdown with static values like "Owner", "admin"?)

    Can you please more information with your scenario for helping me undertand your requirement(better with screenshots)?

    I cannot fully understand your formula(why you use Forall() function). 

    Best regards,

    Allen

  • Coopedup Profile Picture
    347 on at

    Hi Allen,

     

    The fields I'm collecting names from are all SP List person or group fields and the "decision" drop down is a static value field as below.  If I select "Owner" I'm getting a unique list of names from my SP list Owners field, which is great. Though the order seems to match last update and I'd like to make it alphabetical.  As for using ForAll, no reason for it other than that's how I have it working and known no better!  What I didn't make clear in the example code above is that this sits within an If statement with 2 other SP list fields based on select role. I hope this helps?

     

    Thanks for taking your time to look.  

    [Blank(),"Owner", "Mitigation Owner", "Senior Sponsor"]

     

    Coopedup_0-1626684620931.png

     

  • Verified answer
    KvB1 Profile Picture
    1,596 on at

    I don't think you defined which column needs to be sorted to ascending. 

     

     

     Dropdown1.Selected.Value = "Owner",
     Sort(ForAll(Distinct(
     'SP Register'.'Owner',
     { 
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", 
     DisplayName:'Owner'.DisplayName,
     Claims:'Owner'.Claims, 
     Email:'Owner'.Email
     }
     ),Result), Result, Ascending)

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard