@AllanDeCastro it says that 1000 is the maximum, but I guess someone at Microsoft used a < instead of a <= because the most you can get is 999.
There are lots of examples if you google it (And search on here) where it shows 999 is the max.
However, I have discovered there is a skipToken that returns the next 999:
Clear(employees);
Collect(
employees,
Office365Users.SearchUserV2({isSearchTermRequired: "No", top: 999}).value
);
Set(employees1_skip, Last(Split(Office365Users.SearchUserV2({isSearchTermRequired: "No"}).'@odata.nextLink',"=")).Value);
Collect(
employees,
Office365Users.SearchUserV2({isSearchTermRequired: "No", skipToken: employees1_skip}).value
);
Set(employees2_skip, Last(Split(Office365Users.SearchUserV2({isSearchTermRequired: "No", skipToken: employees1_skip}).'@odata.nextLink',"=")).Value);
Collect(
employees,
Office365Users.SearchUserV2({isSearchTermRequired: "No", skipToken: employees2_skip}).value
);
...
However, I am getting all the service and resource accounts, so I am finding thousands more records than just the 3500 I need.
I can filter the records I need but only after I capture them all.
I need to construct some sort of loop, but without being able to use 'Set' in a 'ForAll' loop, this is proving difficult.