cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
therush321
Helper I
Helper I

Filter 0365 users to a select few for a people list

Hi

I am trying to filter down my O365 list of users for a select few for everyone to select. I managed to it working for one user but not multiple.

 

 

Office365Users.SearchUser({searchTerm: "John Cena"}).DisplayName

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
therush321
Helper I
Helper I

I managed to resolve this with the following code in my Items section:

Filter(Office365Users.SearchUser({top:999});
Mail = "test1@abc.co.za"
Or Mail =  "test2@abc.co.za"

Or Mail =   "test3@abc.co.za")

View solution in original post

7 REPLIES 7
eka24
Super User III
Super User III

Have you tried just:

Office365Users.SearchUser({searchTerm: ""}).DisplayName

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

@eka24  Thank you but that does not resolve my issue.

I wanting to filter O365 to a few names or emails. So I would like to limit what a user selects based on my filtering.

eka24
Super User III
Super User III

Create a collection OnStart or Onselect of a button:

ClearCollect(MyUsers,Office365Users.SearchUser({searchTerm:""}).DisplayName)

 

Then Filter as follows:

Filter(MyUsers, DisplayName in ["John Cena", "abc","SSAh"])

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

@therush321 

You can specify as many people you want by their emails.  Load them into a collection like this.  Add more if you like.  Don't use the search method.  Use UserProfileV2 instead.

ClearCollect(colPeople,
    Office365Users.UserProfileV2("jcena@yourcompany.com"),
    Office365Users.UserProfileV2("kcena@yourcompany.com"),
    Office365Users.UserProfileV2("lcena@yourcompany.com"))
)

 

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

Thank you very much but it is not populating anything at all.

I added the code OnStart: 

 

 

ClearCollect(MyUsers;Office365Users.SearchUser({searchTerm:""}).DisplayName)

 

 Then for the items:

 

Filter(MyUsers, DisplayName in ["John Cena", "Tester 123"])

 


It does not populate any names. Any idea on getting this working @eka24 ?

@mdevaney  Thank you but a bit lost on the next steps.

I added the code to OnStart then what should my code look like for my Items?

therush321
Helper I
Helper I

I managed to resolve this with the following code in my Items section:

Filter(Office365Users.SearchUser({top:999});
Mail = "test1@abc.co.za"
Or Mail =  "test2@abc.co.za"

Or Mail =   "test3@abc.co.za")

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (83,979)