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 / How to patch the Share...
Power Apps
Answered

How to patch the Sharepoint people or group column in PowerApps using the If() condition?

(0) ShareShare
ReportReport
Posted on by 20

Hi All,

 

I am trying to patch the Sharepoint people column depending on the if() statement if getting the error below is code

 

'Reserved By':If(DataCardValue10.Value=false,{
 '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
 Claims: "i:0#.f|membership|" & currentUser.Email,
 Department: "",
 DisplayName: currentUser.FullName,
 Email: currentUser.Email,
 JobTitle: "",
 Picture: ""
 
 },{
 Claims: Concatenate("i:0#.f|membership|", DataCardValue11.SelectedItems.Email),
 Department: "",
 DisplayName: DataCardValue11.SelectedItems.DisplayName,
 Email: DataCardValue11.SelectedItems.Email,
 JobTitle: "",
 Picture: ""
 
 })

Please help me with anything wrong with the code.

 

Thanks in Advance.

 

Categories:
  • theapurva Profile Picture
    970 Super User 2024 Season 1 on at

    Hello,
    Please confirm that your datacard DataCardValue11's Property SelectMultiple is set to false.
    then it should work.

     

    You can refer: https://www.spguides.com/create-people-picker-in-power-apps/

  • RajendraRaju_k Profile Picture
    20 on at

    @theapurva 

     

    Datacardvalue11 single selection. Below is the code

    'Reserved By':If(DataCardValue10.Value=false,{
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "i:0#.f|membership|" & currentUser.Email,
     Department: "",
     DisplayName: currentUser.FullName,
     Email: currentUser.Email,
     JobTitle: "",
     Picture: ""
     
     },{
     Claims: Concatenate("i:0#.f|membership|", DataCardValue11.Selected.Email),
     Department: "",
     DisplayName: DataCardValue11.Selected.DisplayName,
     Email: DataCardValue11.Selected.Email,
     JobTitle: "",
     Picture: ""
     
     })

    I am getting the Error:

    The specified user i:0#.f|membership| could not be found. clientRequestId: 4bd6c385-ae3e-4c83-b944-de6525eef568 serviceRequestId: 4bd6c385-ae3e-4c83-b944-de6525eef568

     

  • Verified answer
    v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @RajendraRaju_k ,

     

    Based on your description, i have made a test but it seems that works fine on my side.

     

    1. Here is my SharePoint list.

    vyujincuimsft_1-1655887013017.png

    2. Here is my App.

    Patch(TaskLists,Defaults(TaskLists),{Title:DataCardValue7.Text,Status:{Value:DataCardValue18.Selected.Value},
    'Reserved By':If(DataCardValue18.Selected.Value="false",{
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Claims: "i:0#.f|membership|" & currentUser.Email,
     Department: "",
     DisplayName: currentUser.FullName,
     Email: currentUser.Email,
     JobTitle: "",
     Picture: ""
     
     },{
     Claims: Concatenate("i:0#.f|membership|", DataCardValue19.Selected.Email),
     Department: "",
     DisplayName: DataCardValue19.Selected.DisplayName,
     Email: DataCardValue19.Selected.Email,
     JobTitle: "",
     Picture: ""
     
     })
    })
    

    vyujincuimsft_2-1655887168718.png

    Result Screenshots:

    vyujincuimsft_3-1655887324980.png

    vyujincuimsft_5-1655887540067.png

    In addition, according to the error message, i suggest you to check if the variable(currentUser) has a value.

    vyujincuimsft_6-1655887919222.png

    I could reproduce this error if i set the variable to empty.

    vyujincuimsft_7-1655888007511.png

     

     

     

    Best Regards,

    Charlie Choi

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard