In a Canvas App, there is no People picker field like you have in SharePoint. Instead, you can configure the ComboBox control to act as your people picker field.
First, Add Office365Users as a data source to the app.
From the Insert tab, select the input drop down menu and add the Combo box control to the app.
Now, let’s configure the settings for the Combo box:
First, let’s look at the items properties. To get all the O365 users as choices in the combo box, enter the following formula:
Office365Users.SearchUser({searchTerm: ComboBox.SearchText}).DisplayName)
I used DisplayName as the field that will display from the UserProfile but you can review the available fields and change it as needed.
This will list all the users in the organization as a drop down menu. Loading all users can slow down the app. So instead, we will only load the users if the search box is not empty, and then it will only return the users that are relevant for that search. Here is the updated formula:
If(!IsBlank(ComboBox.SearchText), Office365Users.SearchUser({searchTerm: ComboBox.SearchText}).DisplayName)
Some other properties you may want to configure:
- DefaultSelectItem property to set the current user as the default value use this formula: Office365Users.MyProfile()
- SelectMultiple property to determine if multiple users can be selected. The value can be true or false.