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 / Combine 2 collections ...
Power Apps
Answered

Combine 2 collections into 1

(0) ShareShare
ReportReport
Posted on by 49

In my app I have a collection called 'colProperty' that pulls its information from a SharePoint document library. This document library contains a column called 'Owners' that is a 'Person or Group' field.

 

The following function works and creates a distinct list of all the owners 'DisplayNames' in alphabetical order. However, I was wondering rather than using 2 collections (colAllOwners and colDistinctOwnersAtoZ), would it be possible to just use one collection to achieve a list of distinct Owners in alphabetical order? TIA

 

ClearCollect(colAllOwners, {});
ForAll(colProperty, Collect(colAllOwners, Owner.DisplayName));
ClearCollect(colDistinctOwnersAtoZ, Sort(Distinct(colAllOwners, DisplayName), Value, SortOrder.Ascending));

Categories:
  • Verified answer
    v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @ChrisH2020 ,

     

    Data Source.

    vhanytianmsft_0-1688611979374.png

     

     

    The formula of use one collection to achieve a list of distinct Owners in alphabetical order.

    ClearCollect(Col,Blank());

    ForAll(Sort(Distinct(Documents,Owners.DisplayName),Value,SortOrder.Ascending),Collect(Col,Value))

    vhanytianmsft_1-1688611979376.png

     

     

    Hope this will help you.

     

    Best Regards,

    Tina

  • ChrisH2020 Profile Picture
    49 on at

    Thanks for your help, with a few minor tweaks your suggestion worked 🙂

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard