Note that I was asked how to display a list of Office365 Users Connector in a combo box and set a default value.
Office 365 Users Connector
The “Office365 Users” connector can pull information about users set up in AzureAD and Microsoft365 Center.
*See past articles for where and what values can be set.
List of locations where information can be retrieved by the Office 365 Users Connector
If you are creating an app with Power Automate or Power Apps, you may need information about yourself or other users (li...
Power Automate Power Apps Office365ユーザーコネクタで取得できる情報の設定場所詳細
前回の記事でOffice365ユーザーコネクタ(以下O365コネクタ)で取得できる情報の設定場所一覧を紹介したので、今回の記事ではその設定場所へのたどり着き方をご紹介。 前回紹介した設定場所はこちら OfficeDelve SharePoi
In this article, we will show how to display the list of users retrieved by this “Office365 Users” connector in a combo box.
When using the SearchUser function
First, here is the formula to list users using SearchUser function.
Office365Users.SearchUser()
In addition, if you want to set a default value for a combo box,
If you put the SearchUser function in the “DefaultSelectedItems” property of the combo box as well, and put the email of the user you want to default to the “searchTerm” argument, you can specify the user to be selected in the combo box.
When using the SearchUserV2 function
Here is the next expression that displays the list of users using the SerachUserV2 function.
Office365Users.SearchUserV2({isSearchTermRequired:false}).value
Unlike SearchUser, it is necessary to set isSearchTermRquired to false and add “.value”.
Then, when you want to give the combo box displaying the SerachUserV2 function a default value, put in the SearchUserV2 function with “searchTerm” in the DefaultSelectedItems property, just like the SearchUser function, and the specified user will be selected.
By the way, you can put the SearchUser function in the “DefaultSelectedItems” property instead of SerachUserV2 to set the default value, though,
MyProfileV2 function cannot do this.
Extra: About Search
When both SearchUser and SearchUserV2 are displayed in the combo box, the search seems to work without setting Self.SearchText in “searchTerm”.
If you want to search not only by email but also by display name or something,
You can expand the search by putting the columns you want to search in the combo box SearchFields.
コメント