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

How to update a People Picker field from a combo box in PowerApps

I have a PowerApps form that has 4 datasources - one is the main datasource (a list that stores information from the form) and the other datasources are used to populate comboboxes.  Two of the comboboxes I am having problems with are associated with the People Picker field.  I will use one as an example.  The datasource used to provide a list of names - the field in that list is a People Picker.  The combobox on my form pulls from that list using this formula:
Items:  Distinct('Executive Managers','EMG Name'.DisplayName)

Executive Managers is the name of the list and EMG Name refers to the name of the People Picker field.  The names display nicely in the combobox.  However, I can't get them to save back to the SharePoint list.  I have the Data layout set to "Person", the Primary text and SearchFields are set to "Result" (I can't seem to change this), and the Secondary text is set at "Email".  I tried doing a complicated "Update" formula on the data card(using odata.type, claims, etc) to no avail.  And then I tried a basic formula on the Update property:  cboExecMgr.Selected (where cboExecMgr refers to the combobox control).  That seemed to work once only.  When it worked that one time, the value doesn't appear in the field when the form is opened to that particular record.  Please note that I didn't use SharePoint Group to filter my combobox (which would have been the easier route) because that feature does not appear to be working.  

 

Does anyone have any recommendations? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to update a People Picker field from a combo box in PowerApps

Hi @sposvc ,

If you want to get the proper person to show up in this field when the PowerApp is opened to that particular item in Edit mode, please take a try with the following workaorund:4.JPG

Set the DefaultSelectedItems property of the ComboBox (on your side, it is cboExecMgr ) within the PersonColumn to following:

{
    Result: ThisItem.PersonColumn.DisplayName
}

On your side, you should type following:

{
    Result: ThisItem.YourPersonColumn.DisplayName    /* <-- YourPersonColumn represents the Person column in your Main SP list */
}

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Ecki
Level: Powered On

Re: How to update a People Picker field from a combo box in PowerApps

Hi, the only way to fill a people finder field for me is following ...

 

In the Datacard I used this formula in the Update-property:

{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser"; Claims: "i:0#.f|membership|"&User().Email; DisplayName: User().FullName}

 

And the same formula in the DatacardValue in the DefaultSelectedItems-property:

{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser"; Claims: "i:0#.f|membership|"&User().Email; DisplayName: User().FullName}

 

I used User() because I needed the actual user. In your scenario you have to use your Dropdownbox.Value.

I needed it for setting the value of an "author"-field.

 

I hope this helps you

best regards

Ecki

Community Support Team
Community Support Team

Re: How to update a People Picker field from a combo box in PowerApps

Hi @sposvc ,

Which type column do you use to store the cboExecMgr selected value within your Main SP list? A Person type column or a Single text type column?

 

Based on the needs that you mentioned, I assume that you also use a Person column in your Main SP List to store the cboExecMgr selected value, is it true?

 

I think there is something wrong with the formula you typed within the Update property of the ExecMgr Data card in your Edit form. I have made a test on my side, please take a try with the following workaround:2.JPG

 

3.JPG

Firstly, you need to add a Office 365 Users connection within your app. Then set the Items property of the ComboBox (DataCardValue15) within the PersonColumn Data card in the Edit form to following:

Distinct('20190325_case13',Executor.DisplayName)

On your side, you should type:

Distinct('Executive Managers','EMG Name'.DisplayName)

Set the Update property of the PersonColumn Data card which contains the ComboBox control to following:

{
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUser(),DisplayName=DataCardValue15.Selected.Result).Mail),
  Department: "",
  DisplayName: DataCardValue15.Selected.Result,
  Email: LookUp(Office365Users.SearchUser(),DisplayName=DataCardValue15.Selected.Result).Mail,
  JobTitle: "",
  Picture: ""
}

On your side, you should type (set the Update property of the ExecMgr Data card (in your Edit form) which contains the cboExecMgr to following😞

{
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUser(), DisplayName = cboExecMgr.Selected.Result).Mail),
  Department: "",
  DisplayName: cboExecMgr.Selected.Result,
  Email: LookUp(Office365Users.SearchUser(), DisplayName = cboExecMgr.Selected.Result).Mail,
  JobTitle: "",
  Picture: ""
}

Note: I assume that the Person column in your Main SP List does not enable the "Allow multiple selections" option.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
sposvc
Level: Powered On

Re: How to update a People Picker field from a combo box in PowerApps

In answer to your questions - yes, the Main SP List stores the values in People field and it only accepts a single entry.  I will try what you have recommended!  Also, how do I get the proper person to show up in this field when the PowerApp is opened to that particular item in Edit mode?  Should setting the default property to ThisItem.'Executive Manager' work even though the source is from another list?

 

Thank you for your help!

Community Support Team
Community Support Team

Re: How to update a People Picker field from a combo box in PowerApps

Hi @sposvc ,

If you want to get the proper person to show up in this field when the PowerApp is opened to that particular item in Edit mode, please take a try with the following workaorund:4.JPG

Set the DefaultSelectedItems property of the ComboBox (on your side, it is cboExecMgr ) within the PersonColumn to following:

{
    Result: ThisItem.PersonColumn.DisplayName
}

On your side, you should type following:

{
    Result: ThisItem.YourPersonColumn.DisplayName    /* <-- YourPersonColumn represents the Person column in your Main SP list */
}

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

sposvc
Level: Powered On

Re: How to update a People Picker field from a combo box in PowerApps

This worked perfectly!  Thank you!

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 293 members 5,403 guests
Please welcome our newest community members: