Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Suggested answer

Patching People fields

(0) ShareShare
ReportReport
Posted on by 339
I have left the easiest till last! My final change request is to provide a bulk update on a person field, Owner, in a Sharepoint list.
 
Using two combo boxes to select the current owner and select the new owner. The first combo box, ChangeOwnerFrom, uses a Distinct on the field and the second combo box, ChangeOwnerTo, uses a choice to search for users in our directory. 
 
I'm creating a collection of all records by the current owner and looking to patch with the new owner. The issue is the new users Email details are always blank, despite the other details (JobTitle, Department, DisplayName) being populated. Can anyone shed light on why this may be?
 
Current Owner Items
 
Distinct('Testing of Register App', 'Owner'.DisplayName)
New Owner Items
 
Choices('Testing of Register App'.'Owner')
 The collection and patch (which has no syntax errors).
 
ClearCollect(OwnerCol, Filter('Testing of Register App', 'Owner'.DisplayName = ChangeOwnerFrom.Selected.Value));


ForAll(
    OwnerCol,
        Patch(
        'Testing of Register App',
        ThisRecord,
        {
            'Owner': {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims: "i:0#.f|membership|" & ChangeOwnerTo.Selected.Email,
            Department: "",
            DisplayName: ChangeOwnerTo.Selected.DisplayName,
            Email: ChangeOwnerTo.Selected.Email,
            JobTitle: "",
            Picture: ""
            }
        }
    )
)
 
 
  • WarrenBelz Profile Picture
    148,805 Most Valuable Professional on at
    Patching People fields
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
  • Suggested answer
    WarrenBelz Profile Picture
    148,805 Most Valuable Professional on at
    Patching People fields
    The fundamental issue is that using Choices(ListName.PersonFieldName) will only present choices from entries already in the field in the list. If you want choices from users in the organisation, you need to use something like (there also is another option listing a particular Office365 Group membership.)
    Office365Users.SearchUserV2(
       {
          searchTerm: Self.SearchText,
          isSearchTermRequired: false,
          top: 999
      }
    ).value
    This will however change a few things in the Patch as the schema is different from that of a Person field. Note also that the odata.Type reference is no longer required.
    You also have another potential performance improvement with the ForAll process - ForAll is not designed to be a loop, although it can act that way if it contains an action inside it. ForAll creates a Table, which can be Patched in one action to the data source and will run much faster than individual Patches for each record. If it contains the ID of each record, it will update the specific records, if not it will create new records. I have also used the As disambiguation function here.
    Patch(
       'Testing of Register App',
       ForAll(
          OwnerCol As _Data,
          {
             ID: _Data.ID,
             'Owner': 
             {
                Claims: "i:0#.f|membership|" & Lower(ChangeOwnerTo.Selected.Mail),
                Department: "",
                DisplayName: ChangeOwnerTo.Selected.DisplayName,
                Email: ChangeOwnerTo.Selected.Mail,
                JobTitle: "",
                Picture: ""
             }
          }
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1