cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
carem
Level: Powered On

Can't pick People in Combo Box Person Field?

Hi everybody;

I have a List with 1 Person & Group Column:

Screen Shot 2019-12-06 at 11.42.51 AM.png

 

In PowerApp Studio, I create a Combo Box and Setting the Properties:

Items: Choices(TestPatchFunctionList.PersonField)

But when I click on the Combo Box, it can't display any of the User I have in Azure Directory.

Screen Shot 2019-12-06 at 11.51.20 AM.pngBefore click

 

Screen Shot 2019-12-06 at 11.51.16 AM.pngAfter clicked

 

 

I have another question, if I have Office365Users Connection in the App, I create a Combo Box to Populate User in some scenarios:

1/ All User  I have in Azure Directory

2/ User that is the Manager of Current User using the App

3/ Users that is the Direct Report of Current User using the App

4/ Users that are in a Specific Department

Can I do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: Can't pick People in Combo Box Person Field?

Hi @carem 

 

It is not showing any values in this case, because the choice on a field of Person works when something is searched from the combobox. To rectify this, you need to Enable "Allow Searching" in the combobox properties.

Also, if you want to use the Office365Users connection, you can use below expressions:
Make sure that you have enabled "Allow Searching" in the control.

1/ All User I have in Azure Directory
Office365Users.SearchUser()

2/ User that is the Manager of Current User using the App
Office365Users.ManagerV2(User().Email)
This gets the Manager details for current loggedin user

3/ Users that is the Direct Report of Current User using the App
If(!IsBlank(User().Email),Office365Users.DirectReportsV2(User().Email))

4/ Users that are in a Specific Department
Filter(Office365Users.SearchUser(),Department = "Department1")

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User
Dual Super User

Re: Can't pick People in Combo Box Person Field?

Hi @carem 

 

It is not showing any values in this case, because the choice on a field of Person works when something is searched from the combobox. To rectify this, you need to Enable "Allow Searching" in the combobox properties.

Also, if you want to use the Office365Users connection, you can use below expressions:
Make sure that you have enabled "Allow Searching" in the control.

1/ All User I have in Azure Directory
Office365Users.SearchUser()

2/ User that is the Manager of Current User using the App
Office365Users.ManagerV2(User().Email)
This gets the Manager details for current loggedin user

3/ Users that is the Direct Report of Current User using the App
If(!IsBlank(User().Email),Office365Users.DirectReportsV2(User().Email))

4/ Users that are in a Specific Department
Filter(Office365Users.SearchUser(),Department = "Department1")

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

carem
Level: Powered On

Re: Can't pick People in Combo Box Person Field?

Thanks, @yashag2255 !

You save me a day. I will try the formula you give into suitable scenarios.

carem
Level: Powered On

Re: Can't pick People in Combo Box Person Field?

@yashag2255 

I want to patch the person who Direct Report and the manager of the Current User to the Person Field in Sharepoint.

I create 2 Buttons and set OnSelect Property:

Patch(TestPatchFunction, First(TestPatchFunction), {PersonField: Office365Users.DirectReportsV2(User().Email)})

Patch(TestPatchFunction, First(TestPatchFunction), {PersonField: Office365Users.ManagerV2(User().Email})

It reports an error: Invalid Argument Type, Expecting a Record but in a different Schema.

How Can I fix It?

Dual Super User
Dual Super User

Re: Can't pick People in Combo Box Person Field?

Hi @carem 

 

The schema for a Person type field is different from what is returned through the Office365 connector.

You can use the below expression as:

Direct Reportees
Clear(ReporteeCollection);
ForAll(Office365Users.DirectReportsV2(User().Email).value,Collect(ReporteeCollection, {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Lower,
Department:"",
DisplayName:displayName,
Email:mail,
JobTitle:".",
Picture:"."}));
Patch(TestPatchFunction, First(TestPatchFunction), {PersonField: ReporteeCollection})

Managers
Set(ManagerDetails,Office365Users.ManagerV2("user2@testmppco.onmicrosoft.com"));
Patch(TestPatchFunction, First(TestPatchFunction), {PersonField: Table({'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Lower(ManagerDetails.mail),
Department:"",
DisplayName:ManagerDetails.displayName,
Email:ManagerDetails.mail,
JobTitle:".",
Picture:"."})
})

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,559)