Hi all,
I'm trying to add all users from the Microsoft365users connector to a collection (as the default search ability of the connector doesn't search what we want).
When I do e.g. this
ClearCollect(
AllUsers,
Microsoft365Users.SearchUserV2({top:1000})
);
The collection is not what I expected, instead it has two columns
@odata.nextLink
value
when I browse into "value" it shows what I was originally expecting
How can I get the collection to just show as the columns in "value" instead of the "@odata.nextLink, value" columns?
Thanks!
Dylan
Solved! Go to Solution.
Hi @baarsd ,
Do you want to the 'searchTerm' to be applied to company-only users?
If you want to search company-only users using the Microsoft365Users.SearchUserV2() function through the 'searchTerm' attribute, I afraid that there is no way to achieve your needs currently.
Currently, the 'searchTerm' attribute in Microsoft365Users.SearchUserV2() function is only applied display name, given name, surname, mail, mail nickname and user principal name. Please check the following article for more details:
https://docs.microsoft.com/en-us/connectors/office365users/#search-for-users-(v2)
If you would like this feature to be added in Microsoft365Users.SearchUserV2() function, please consider submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas
As an possible solution, just as I mentioned above, you could consider create a custom connector based on Microsoft Graph REST API, then you could define a action in your custom connector along with the search query parameters.
https://docs.microsoft.com/en-us/graph/query-parameters#odata-system-query-options
Regards,
OK so I fix that up with
Clear(AllUsers);
ForAll(
Temp,
Collect(
AllUsers,
value
))
however the searchUserv2 appears to only ever return 1000 users - is there a way to increase this number or to use searchTerm to search for all?
Hi @baarsd ,
Regarding your original issue, please also consider try the following formula:
ClearCollect(
AllUsers,
Microsoft365Users.SearchUserV2({top:1000}).value
);
For your second question, do you want to retrieve more than 1000 users using your Microsoft365Users.SearchUserV2 function? I afraid that there is no way to achieve your needs in PowerApps currently, it is an known limit with the Microsoft365Users connector.
As possible solution, I think a customer connector could achieve your needs. You could consider create a custom connector based on Microsoft Graph REST API, then define a List users action in this custom connector to retrieve all users in your tenant. Then within your canvas app, you could create a connection to this custom connector, and then use the custom connector action to retrieve users from your tenant.
More details about creating a custom connector using Microsoft Graph API, please check the following blog:
Regards,
Hi, thanks for your response! Re: searching, is it possible to use searchTerm to search for company-only users? AAD and the SearchUser command in PowerApps returns guests, online (cloud) users, AD-synced users, resource mailboxes...etc. I just want it to return AD-synced users.
Hi @baarsd ,
Do you want to the 'searchTerm' to be applied to company-only users?
If you want to search company-only users using the Microsoft365Users.SearchUserV2() function through the 'searchTerm' attribute, I afraid that there is no way to achieve your needs currently.
Currently, the 'searchTerm' attribute in Microsoft365Users.SearchUserV2() function is only applied display name, given name, surname, mail, mail nickname and user principal name. Please check the following article for more details:
https://docs.microsoft.com/en-us/connectors/office365users/#search-for-users-(v2)
If you would like this feature to be added in Microsoft365Users.SearchUserV2() function, please consider submit an idea to PowerApps Ideas Forum:
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas
As an possible solution, just as I mentioned above, you could consider create a custom connector based on Microsoft Graph REST API, then you could define a action in your custom connector along with the search query parameters.
https://docs.microsoft.com/en-us/graph/query-parameters#odata-system-query-options
Regards,
User | Count |
---|---|
253 | |
113 | |
92 | |
48 | |
38 |