cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cgarib
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
mdevaney
Super User
Super User

@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
mdevaney
Super User
Super User

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

Works really fine!... tnaks a lot!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,763)