Hi,
I ended up completely customising the search function as the office365users connection doesn't allow searching by department or jobtitle. I changed the gallery to this:
If(
!IsBlank(txtFindPeople.Text),
Search(GroupUsers, txtFindPeople.Text,"Department","displayName","jobTitle","userPrincipalName"
)
)
And created a new collection called GroupUsers which collects all the members that are in the our company only 365 group and then adds columns to that collection looking up each member by ID. I only needed to add the department to this collection as the Office365Groups connection brings in the job title field.
clearCollect(GroupUsers, AddColumns(Office365Groups.ListGroupMembers("2236fed9-2b9c-429d-a509-0acf0ceff5b7", {'$top':999}).value, "Department",Office365Users.UserProfile(id).Department));
We only have 500 employees so this works for us, as stated if you have over 999 you'd need to use the workaround from Shane , which I believe is loading the maximum return results into Collection A, then finding the next set of results that aren't in Collection A, and added them to Collection B, and so on until all users are collected and then adding all collections together into a final master collection that you can then use the search/filter functions on.