web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch person from SP L...
Power Apps
Answered

Patch person from SP List back to SP List

(0) ShareShare
ReportReport
Posted on by 41

Hi all

 

I would like to patch a person back to the same SP List but I always get an error. In the DefaultSelectedItems of the dropdown I took ThisItem.Owner. For the Items I took: Office365Users.SearchUser({searchTerm:DataCardValue3.SearchText,top:10}) and in the OnChange properties I took: 

UpdateContext({locSelectedUserEmail: Lower(First(DataCardValue3.SelectedItems).Mail),
locSelectedUserDisplayName: First(DataCardValue3.SelectedItems).DisplayName})

 

My Patch function it looks like this:

Owner: {

'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpanderUser",
Claims: "i:0#.f|membership|" & locSelectedUserEmail,
Department: "",
DisplayName: locSelectedUserDisplayName,
Email: locSelectedUserEmail,
JobTitle: ".",
Picture: "."
},

 

I guess it has something to do with my DefaultSelectedItems property of the Dropdown but I'm actually stuck now.

 

Any idea?

Thanks a lot!

Best

Lukas

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    Hi @LFusGo ,

    Firstly get rid of the OnChange as it will not trigger unless something is changed - if the Items is

    Office365Users.SearchUser(
     {
     searchTerm: Self.SearchText,
     top: 10
     }
    )

    the Combo Box is Single select with Searching enabled, the DefaultSelectedItems is

    ThisItem.Owner

    then a Patch of

    Owner: 
    {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpanderUser",
     Claims: "i:0#.f|membership|" & Lower(DataCardValue3.Selected.Mail),
     Department: "",
     DisplayName: DataCardValue3.Selected.DisplayName,
     Email: DataCardValue3.Selected.Mail,
     JobTitle: ".",
     Picture: "."
    }

    should work (and does on a test I did here)

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • LFusGo Profile Picture
    41 on at

    Hi @WarrenBelz 

     

    Thanks for your help! I still get an erorr.

    I attached the properties of my ComoBox and the patch function of the owner.

    The error I get is: Requested operation is invalid.

     

    Thanks again!

    Best

    Lukas

    Patch.PNG
    Combobox.PNG
  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    Hi @LFusGo ,

    Firstly, please post all code as Text - saves re-typing - for a test, try this

    Patch(
     Assets,
     {ID: Galleryl.Selected.ID},
     {
     Barcode: Label_2.Text,
     Title: TextInput1_1.Text,
     Owner: 
     {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpanderUser",
     Claims: "i:0#.f|membership|" & Lower(DataCardValue3.Selected.Mail),
     Department: "",
     DisplayName: DataCardValue3.Selected.DisplayName,
     Email: DataCardValue3.Selected.Mail,
     JobTitle: "",
     Picture: ""
     }
     }
    )

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • LFusGo Profile Picture
    41 on at

     

    Hi @WarrenBelz 

    Sorry for sending picture instead of text.

    I copied you the whole Patch function. It's not working like this.

    // show the spinner
     UpdateContext({locShowSpinner: true});
     Patch(
     Assets,
     //Gallery1.Selected,
     {ID: Gallery1.Selected.ID},
     EditForm1_2.Updates,
     {
     Barcode: Label2_2.Text,
     Title: TextInput1_1.Text,
     Owner: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpanderUser",
     Claims: "i:0#.f|membership|" & Lower(DataCardValue3.Selected.Mail),
     Department: "",
     DisplayName: DataCardValue3.Selected.DisplayName,
     Email: DataCardValue3.Selected.Mail,
     JobTitle: ".",
     Picture: "."
     },
     Category: {
     '@odata.type': "Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Value: Dropdown1_1.Selected.Value
     },
     Maintain: DataCardValue1_4.SelectedDate,
     'Additional Info': DataCardValue6.Text,
     Location: {
     '@odata.type': "Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Value: Dropdown3_1.Selected.Value
     },
     Status: {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id: 1,
     Value: "Available"
     }
     }
     );
     
    // hide the spinner
    UpdateContext({locShowSpinner: false});
     
    //Navigate(ConfirmScreenAdmin);
    UpdateContext({ShowPopupReset: false});
     Notify(
     "Changes have been saved successfully",
     Success
     );
     Navigate(BrowseScreen1
    )

     

     

    Thanks a lot!

    Best

    Lukas

  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    @LFusGo ,

    Did you test what I sent you - I am trying to isolate the issue. The properties of the Combo Box should not affect this as you are patching directly the item selected (I assume you have selected this before you patch).

  • LFusGo Profile Picture
    41 on at

    @WarrenBelz 

     

    Yes, I copied your code into mine.

    Actually I don't select the User actively, because with "ThisItem.Owner" it's taken directly from the SP list.

     

    Best

    Lukas

  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    @LFusGo ,

    I am talking about the abbreviated code - I am trying to isolate the issue - if you do this, does it work ?

    Patch(
     Assets,
     {ID: Galleryl.Selected.ID},
     {
     Owner: 
     {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpanderUser",
     Claims: "i:0#.f|membership|" & Lower(DataCardValue3.Selected.Mail),
     Department: "",
     DisplayName: DataCardValue3.Selected.DisplayName,
     Email: DataCardValue3.Selected.Mail,
     JobTitle: "",
     Picture: ""
     }
     }
    )

     

  • LFusGo Profile Picture
    41 on at

    @WarrenBelz 

     

    No. I've tried the abbreviated code only but also didn't work. It works if I change the owner in the dropdown, but if I didn't change anything it doesn't work.

  • WarrenBelz Profile Picture
    154,447 Most Valuable Professional on at

    @LFusGo ,

    Interesting as it works on my test whether you change the value or not - try going the "long way" with the DefaultSelectedItems

    {
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpanderUser",
     Claims: "i:0#.f|membership|" & Lower(ThisItem.Owner.Email),
     Department: "",
     DisplayName: ThisItem.Owner.DisplayName,
     Email: ThisItem.Owner.Email,
     JobTitle: ".",
     Picture: "."
    }

     

    Please click Accept as solution 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 Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • LFusGo Profile Picture
    41 on at

    @WarrenBelz 

     

    Still not. I get the same error again.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard