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 / Create a collection (J...
Power Apps
Answered

Create a collection (Job Titles per Department) from Office365

(0) ShareShare
ReportReport
Posted on by 8

Is it possible to create a collection having Job Titles per Department from Office365Users?

 

Thanks a lot!

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @cgarib 
    Here is some code you can plug into your Power Apps to create a unique list of departments and titles.

    ClearCollect(
     colDeptTitles,
     SortByColumns(
     ForAll(
     Distinct(
     ShowColumns(
     Office365Users.SearchUserV2({top: 999}).value,
     "Department",
     "JobTitle"
     ),
     ThisRecord
     ),
     ThisRecord.Result
     ),
     "Department",
     Ascending,
     "JobTitle",
     Ascending
     )
    )

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

  • cgarib Profile Picture
    8 on at

    Works really fine!... tnaks a lot!

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

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard