I'm clicking on a button from within a gallery to patch the name of the current user into a SharePoint list. The formula I'm using is listed at the bottom of this submission.
Everything works perfectly fine until I add the "Name" column. Then, it does not give me an indicator of a formula error but fails on click.
I checked the Name setting in the field in my SharePoint list and found the following:
It is a Person or Group field.
It is not required.
It does not have unique values
It does not allow multiple selections
Allows people only selection
Can choose from all users
Also, I added a label to see what varCurrentUser shows and it has my email and full name as the current user. The full name as displayed in the label shows in exactly the format I'd expect to see in my list.
If I use varCurrentUser.Email at the end of the Claims line, this is the message I get:
"The requested operation is invalid. Server response: ERG registration failed. The specified user _scrubbedSensitiveData_could not be found."
If I use varCurrentUser.FullName at the end of the Claims line, this is the message I get: "The requested operation is invalid. Server response: ERG registration failed. The specified user i.0#.f|membership|Zalme, Cindy could not be found."
Here is my formula:
Patch('ERG Registration', Defaults('ERG Registration'),
{Title:varCurrentUser.FullName,
EmployeeNumberorEmail:varCurrentUser.Email,
EventID:ThisItem.ID,
EventName:ThisItem.Title,
EventSubHeadline:ThisItem.OneLineSubHeadline,
Name:{
Claims: Concatenate("i.0#.f|membership|",varCurrentUser.FullName),
Department:"",
DisplayName:varCurrentUser.FullName,
Email:varCurrentUser.Email,
JobTitle:"",
Picture:""}
})
Does anyone have any insight to this. I've exhausted all I know to do.
Thank you.
Solved! Go to Solution.
@CindyZ , the issue that is causing the scrubbedSensitiveData error is with the format of the claims. You have a period where there should be a colon and you should be using Email and not FullName.
You have: Claims: Concatenate("i.0#.f|membership|",varCurrentUser.FullName)
Should be: Claims: Concatenate("i:0#.f|membership|",varCurrentUser.Email)
Please try the following,
Patch('ERG Registration', Defaults('ERG Registration'),
{Title:varCurrentUser.FullName,
EmployeeNumberorEmail:varCurrentUser.Email,
EventID:ThisItem.ID,
EventName:ThisItem.Title,
EventSubHeadline:ThisItem.OneLineSubHeadline,
Name:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & User().Email,
Department:"",
DisplayName:User().FullName,
Email:User().Email,
JobTitle:"",
Picture:""
}
)
FYI - the @odata.type part is long not needed.
@CNT, thanks so much for your recommendation!!! I tried that and proofed it several times as well as tried the variable in the same places and I'm still getting the scrubbed error. I really appreciate your making the suggestion; I was breathlessly hopeful!!
@CindyZ Did you get it to work?
Please remember to give a 👍 and accept my solution as it will help others in the future.
No, I'm sorry, I did not .
What problem are you still having?
Your formula should be:
With({_user: User()},
Patch('ERG Registration',
Defaults('ERG Registration'),
{
Title: _user.FullName,
EmployeeNumberorEmail: _user.Email,
EventID: ThisItem.ID,
EventName: ThisItem.Title,
EventSubHeadline: ThisItem.OneLineSubHeadline,
Name:{
Claims: "i:0#.f|membership|" & Lower(_user.Email),
Department: "",
DisplayName: _user.FullName,
Email: _user.Email,
JobTitle: "",
Picture: ""
}
}
)
)
I only added the extra _user part to this to make sure that the User() function is assigned properly. I am sure you have it right in the varCurrentUser variable, but I wanted to take the mystery out.
@RandyHayes Thanks so very much for checking back in with me. I'm getting ready to compare/check back into this and I plan to use your "With". However, I don't get the option of a "underscore user...". Did you mean the underscore literally. I only get an "underscore selecteduser".
Thanks!
The _user is a literal name to be used. It is the name of the variable defined in the With statement.
That formula provided "should be" 100% on the money as-is!
So, it still is not taking it. I stripped everything out of my formulas EXCEPT what you provided -- which I cut and paste and I then also tried what I had. I either case, I'm getting this message.
Also, as a check, I did create a label and it does show my email.
So, I think i'll try one more thing and then sideline this until Monday.
As always, thanks so much! And I will buy you a cup of coffee!!!
User | Count |
---|---|
256 | |
110 | |
90 | |
51 | |
44 |