web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error Patching a Perso...
Power Apps
Answered

Error Patching a Person Column

(0) ShareShare
ReportReport
Posted on by

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. 

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @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 Profile Picture
    76,297 Super User 2024 Season 1 on at

    @CNT 

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

     

  • CindyZ Profile Picture
    on at

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

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @CindyZ Did you get it to work?

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • CindyZ Profile Picture
    on at

    No, I'm sorry, I did not . 

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

     

     

  • CindyZ Profile Picture
    on at

    @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 Profile Picture
    76,297 Super User 2024 Season 1 on at

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

  • CindyZ Profile Picture
    on at

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

  • CindyZ Profile Picture
    on at

    Soooo, I added a new person and group column and tried to direct it to a new column thinking maybe that was the issue -- though different than the message suggests.  No go; same red x and message. 

     

    But, thanks! 

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard