cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CindyZ
Post Partisan
Post Partisan

Error Patching a Person Column

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

@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)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

15 REPLIES 15
CNT
Super User
Super User

@CindyZ 

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:""
	}
)
RandyHayes
Super User
Super User

@CNT 

FYI - the @odata.type part is long not needed.  

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
CindyZ
Post Partisan
Post Partisan

@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 . 

 

RandyHayes
Super User
Super User

@CindyZ 

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.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@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! 

 

RandyHayes
Super User
Super User

@CindyZ 

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!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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.  

CindyZ_0-1638569489514.png



Also, as a check, I did create a label and it does show my email. 

CindyZ_1-1638569537704.png

 

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!!!  

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,096)