People picker Control in PowerApps
With the latest PowerApps update we can do more customization to achieve more use-cases. Especially with the new "Rule" feature in PowerApps(which keeps remembers me of InfoPath form 😏)
But, Then I was looking for People picker control in this latest PowerApps update. cant find any straight forward control thought. But now saw a connector called "Office365Users" then I started exploring it.
2. Insert a "Combobox" from the ribbon.
3. Select "Combobox" and select 'Items' in the formula bar then enter below formula
5. Play the app and test it.
There are a couple of controls and ways to create People Picker control
Office365Users.SearchUser({searchTerm:txtSearchUser.Text}).UserPrincipalName
If(Rule3, Office365Users.SearchUser({searchTerm:txtSearchUser.Text}).UserPrincipalName)
Office365Users.SearchUser({searchTerm:ddlDetailedPeoplePicker.SearchText})
If(Rule2, Office365Users.SearchUser({searchTerm:ddlPeoplePicker.SearchText}))
But, Then I was looking for People picker control in this latest PowerApps update. cant find any straight forward control thought. But now saw a connector called "Office365Users" then I started exploring it.
How to create People picker control in PowerApps
Update
1. Add "Office365Users" data source to the app.2. Insert a "Combobox" from the ribbon.
3. Select "Combobox" and select 'Items' in the formula bar then enter below formula
Office365Users.SearchUser({searchTerm: ComboBox1.Text})
4. Then, select "Fields" from the property pane and choose "Primary text" a.k.a "Display Names" and "Search Fields".5. Play the app and test it.
The below steps applies mostly in the early stages/release of PowerApps now that its matured enough, so follow the updated steps instead.
There are a couple of controls and ways to create People Picker control
- Using Input box & ListBox
- On-demand/Autocomplete users (With rules)
- Prepopulated users (Without rules)
- Using ComboBox control
- on-demand/Autocomplete users
- Prepopulated users
App Setup
First, Add "Office365Users" data source to the app
Second, design the app with Input box, ListBox, ComboBox controls
Using Input box & ListBox control
Prepopulated [without rule]:
This is NOT RECOMMENDED as this will prepopulate users, when user base is huge it will certainly degrade the app performance.
Select list box -> formula bar
Office365Users.SearchUser({searchTerm:txtSearchUser.Text}).UserPrincipalName
On demand [With rules]:
This will query user as we type in textbox, follow the below step and add this formula
If(Rule3, Office365Users.SearchUser({searchTerm:txtSearchUser.Text}).UserPrincipalName)
Using ComboBox control
Prepopulated [without rule]:
This is NOT RECOMMENDED as this will prepopulate users, when user base is huge it will certainly degrade the app performance.
Office365Users.SearchUser({searchTerm:ddlDetailedPeoplePicker.SearchText})
On demand [With rules]:
This will query user as we type in combobox, follow the below step and add this formula
If(Rule2, Office365Users.SearchUser({searchTerm:ddlPeoplePicker.SearchText}))
Now, Select "Display fields":
Then finally select "Search Fields":
Hi, this is great but i wish the instructions were clearer? There is a lot of guess work and i can't get passed the first couple of steps because i don't know how to the define the controls.
ReplyDeleteHello, Please refer related articles to establish new data source:
Deletehttp://ratsubsharewall.blogspot.com/2017/03/develop-powerapps-from-scratch-series1.html
Then, Go to Insert->Control->Listbox/Combobox
I cannot get a combo box to display anything in a dropdown. I really like what you have here where you search the combo box, then display the DisplayName and Mail (actually exactly what I need), but when i search there are no options that show up.
DeleteHowever, when i connect the combo box search to a list box all the options show in the list box.
Any idea why the results do no show in the combo box?
Make sure you did mapped "Search Field" and "Display Fields" for Combobox.
DeleteWhat are the rules that you created? You say that the rules are needed but you don't actually show the full rule you created. That makes me sad, now I need to go find a different explanation how to create the people picker.
ReplyDeleteIf(Rule2, Office365Users.SearchUser({searchTerm:ddlPeoplePicker.SearchText})) check this image to configure rules.
DeleteVery interesting. Could you wire up the listbox to display users from a multi-value person column from a SharePoint list?
ReplyDeleteThis is amazing!! Thank you so much, exactly what I needed. 'On Demand [with rules] for the combo box is the way to go.
ReplyDeleteFor the people that didn't manage to follow this in the first couple of tries. I was stuck at the rules thing (combobox case).
ReplyDeleteI tried to click on 'Define actions' and put in the formula that way, but that is not necessary. These are the steps that I followed:
1) Add the rule
2) Define the condition
3) Exit the rule screen
4) Add the formula given by Rathanavel to the Items property of the combobox (replacing the name of your just created rule)
If you go back to your rules you will notice that PowerApps itself put the actions there.
Thanks Rathanavel for this solution.