I currently have a page that users can enter search criteria into a text box and a gallery will show all Office365 users that match the criteria. The gallery has the photo, DisplayName and Department. I want to modify this gallery so that it only searches Office 365 users that have an email address in a list.
I put the list of email addresses into a collection using this:
ClearCollect(collection1,ShowColumns('[dbo].[vw_EmailAddresses]',"email_address"))
I tried this under Items for the gallery:
Sort(Filter(Office365Users.SearchUser({searchTerm:"", top:500}), Mail in collection1.email_address),DisplayName))
The problem is that this code only searches the first 500 users who are in the email list. I want it to search all Office365 users and show who are in the list. If I omit "top:500", then no results are returned.
EDIT: Forgot to mention that I want the gallery to be populated when the screen first opens. Here is the full code I have under Items:
If(!IsBlank(txtSearch.Text),
Sort(Filter(Office365Users.SearchUser({searchTerm:txtSearch.Text}),Mail in collection1.email_address),DisplayName)
,Sort(Filter(Office365Users.SearchUser({searchTerm:"", top:500}), Mail in collection1.email_address),DisplayName)
)

Report
All responses (
Answers (