Hi there,
I'm trying to patch some data into a sharepoint list, however I get "Network Error when using Patch function: The requested operation is invalid" when trying to patch the People column called Requestee. The other two columns work fine.
otherUsers is a variable declared from a button which collects ThisItem in a peoplepicker. I've tried using Office365Users.MyProfileV2() instead and it still happens. No idea why this is happening and the syntax seems correct to me. All help is appreciated thanks.
Patch(
'Access Level Requests',
Defaults('Access Level Requests'),
{
Requestee: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & otherUsers.mail,
Department: "",
DisplayName: otherUsers.displayName,
Email: otherUsers.mail,
JobTitle: "",
Picture: ""
},
'Requested Access Level': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: 1,
Value: roleList.Selected.Value
},
'Reason for Request': otherUsersReason.Text
}
)
I found the solution! Turns out I had to use otherUser.UserPrincipleName instead of .Mail as our organisation uses a separate front-facing email address which is what the .Mail option returns.
Hi Akshansh-Sharma,
This works if I use a string with an email in replacement of UserEmail, however it still doesn't if I use otherUser.Mail or Office365Users.MyProfileV2().mail.
I basically want the Requestee column to be populated with the details of the person selected in my people picker gallery. The button just has Set(otherUser, ThisItem) and it seems to work in other places in the app.
Hi ANB,
Thanks for your response.
Here's the screenshot.
Hi @aantoniou ,
can you please give this code a try
requestee: {
Claims: "i:0#.f|membership|" & Lower(UserEmail),
Department: "",
DisplayName: User().FullName,
Email: UserEmail,
JobTitle: "",
Picture: User().Image
}
--------------------------------------------------------------------------------------------------------------------
Please click Accept as solution if my post helped you solve your issue. If the content was useful in other ways, please consider giving it Thumbs Up 😉
LinkedIn- https://www.linkedin.com/in/akshansharma/
Hi @aantoniou Can you share the screenshot of Requestee column from your SP list. I wanted to see the setting of the column.
Thanks,
ANB
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional