Hi,
I am trying to return a list of AD Domain synchronised users, using the Office365Users.SearchUserV2 function and are experience some unintended results. I am trying to return a subset of users based on the following criteria:
- Account is enabled
- The account is not a guest account
- The company name is "Acme" (substituted for post).
This is the code I am using:
ClearCollect(
colAllUsers,
Filter(Office365Users.SearchUserV2({isSearchTermRequired:false}).value, CompanyName="Acme" && AccountEnabled = true && !("#EXT#" in UserPrincipalName))
);
There should be circa 80 users returned, but I only get back 61. Examining the collection it shows the expected results in alphabetical order - but only up to the letter M.
If I try and widen the search by only including the company name in the search terms, I expect to get back circa 250 users, but only get back 119 - only up to a few entries that start with the letter N.
I have checked some synchronised users outside the returned results and can't see a reason why they would be excluded.
Has anyone seen this behaviour before?
Thanks in advance,
Matt