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

Update field from another field - however people picker is involved !!

I have a customized sharepoint list form and am trying to do the following

 

1.  When someone picks an item from a choice field a corresponding person is automatically selected (from another data source in the app.) and added to a people/person field

 

I can get that part to semi-work !!  as in I can populate the field with the correct person using the following formula as the default for the people/person field (If I change the people field to be a text input field !)

 

First(Distinct(Filter(Owners,Title=DataCardValue6.Selected.Value),Owner.DisplayName)).Result

 

However what I can't do is get this to write back to the sharepoint list?  No error messages but if I add an item to the list the field is not updated ?  I know people fields are notoriously tricky so maybe I need to go at it another way?

 

What I really want to achieve is that when someone adds a new item to the list and makes a choice from a dropdown then a people field updates with a particular person.  Reason being I need this to create a filtered view using [Me] for someone accessing the list at a later stage.  Hope you can follow that.

 

any ideas   thanks

 

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Update field from another field - however people picker is involved !!

Hi @vffdd ,

 

The result of this formula only contains the DisplayName of the people. But to update a person and group field, you need multiple values. You need to use Patch to update the record rather than Submit function. The formula should be something like:

 

Patch(List,Default(List),{ TitleSmiley Very HappyataCardValue9.Text,
       Person: {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                       Claims:"i:0#.f|membership|Lower(First(Distinct(Filter(Owners,Title=DataCardValue6.Selected.Value),Owner.Email)).Result)",
                   Department:"",
                  DisplayName:First(Distinct(Filter(Owners,Title=DataCardValue6.Selected.Value),Owner.DisplayName)).Result,
                        Email:First(Distinct(Filter(Owners,Title=DataCardValue6.Selected.Value),Owner.Email)).Result,
                     JobTitle:"",
                      Picture:""
             }})

 

Regards,

Mona

 

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

Re: Update field from another field - however people picker is involved !!

Hi @vffdd , 

 

For solving this scenario, you can use the Office365 connector to fetch the user details and modify the datacard of the person/people field instead of the field_datacard value,  As the value is being fetched from the parent (that is the datacard).
Expression: 
If(SharePointForm1.Mode = New,LookUp(Office365Users.SearchUser(),DisplayName = User().FullName),ThisItem.Approver)
In the above expression, Approver is my sharepoint list column of type Person/Group. You can put this expression as shown in the screenshot below: MicrosoftTeams-image (31).png

 

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 224 members 4,764 guests
Please welcome our newest community members: