cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Create a collection (Job Titles per Department) from Office365

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

 

Thanks a lot!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@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." 

View solution in original post

2 REPLIES 2
Super User III
Super User III

@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." 

View solution in original post

Works really fine!... tnaks a lot!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,651)