Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Patch function gives error while saving person type to Sharepoint List

(1) ShareShare
ReportReport
Posted on by
Hello,
 
I am new to Power app and facing error while saving data back to sharepoint list.
 
I have a assigned to comboBox, I have added this code at it item property:

Item = Office365Users.SearchUser({searchTerm:ComboBox_AssignedTo.SearchText})
 
and on Submit button On Select Property I have added patch function with below code.
 
Patch(
    'CHARM CTAS Action Tracker',
    Defaults('CHARM CTAS Action Tracker'),
    {
            'Assigned To':{
            '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims:"i:0#.f|membership|"& ComboBox_AssignedTo.Selected.Mail,
            Department:ComboBox_AssignedTo.Selected.Department,
            DisplayName:ComboBox_AssignedTo.Selected.DisplayName,
            Email:ComboBox_AssignedTo.Selected.Mail,
            JobTitle:ComboBox_AssignedTo.Selected.JobTitle,
            Picture:""
        })
 
On clicking submit, I am getting error as :
The specified user i:0#.f|membership| could not be found.
clientRequestId: 57a528bd-367d-458f-9fb6-a061b1c32886
serviceRequestId: 1e5b78a1-c0ab-b000-5f48-eec95deb1af5
 
Please help with the solution.
  • WarrenBelz Profile Picture
    WarrenBelz 145,475 on at
    Patch function gives error while saving person type to Sharepoint List
    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
  • WarrenBelz Profile Picture
    WarrenBelz 145,475 on at
    Patch function gives error while saving person type to Sharepoint List
    Hi @CU17011003-0​​​​​​​
    Assuming the Items of ComboBox_AssignedTo is (note small improvement)
    Office365Users.SearchUserV2(
       {
          searchTerm: Self.SearchText,
          top: 999
       }
    ).value
    and it a single selection Combo Box and 'Assigned To' is a single value Person field, then the Patch of
    Patch(
       'CHARM CTAS Action Tracker',
       Defaults('CHARM CTAS Action Tracker'),
       {
          'Assigned To':
          {
             Claims: "i:0#.f|membership|" & Lower(ComboBox_AssignedTo.Selected.Mail),
             Department: ComboBox_AssignedTo.Selected.Department,
             DisplayName: ComboBox_AssignedTo.Selected.DisplayName,
             Email: ComboBox_AssignedTo.Selected.Mail,
             JobTitle: ComboBox_AssignedTo.Selected.JobTitle,
             Picture: ""
          }
       }
    )
    should work - note you were missing the blue highlighted part and you do not need the 'odata.type' line now, although that does not really explain the error you have. As a debugging exercise, put this on a Label when you have selected something in the Combo Box and see if you get a valid email
    ComboBox_AssignedTo.Selected.Mail

    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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard