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 / How to patch data in S...
Power Apps
Answered

How to patch data in System User Entity?

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have created a "CustomField1" in system user entity where I want to patch a data by user from the canvas app and I am using following formula against the System Users Collection:

 

 

Patch( Users, First( Filter( CollUsers, 'Primary Email' = User().Email ) ), { CustomField1: "Testing" } );

 

 

Above formula doesn't throw an error, at the same time, it's not patching value "Testing" into CustomField1 for the current user too.

 

Can you please share what is wrong here?

 

Thanks,

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @dave8 

     

    Do you want to patch the CustomField1 to the User entity?

     

    If you do, the Patch formula should be:

     

    Patch( Users, First( Filter(Users, 'Primary Email' = User().Email )), { CustomField1: "Testing" }))

     

    The Patch functions works in syntax like Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ]), the BaseRecord you want to modify should be in the data source.

     

    You created a collection “CollUsers”, could you please share more details about your scenario? Collections collect one or many records form data sources, but store them temporarily. Modify a collection won’t affect the records in data source even if they are totally same.

     

    Best regards,
    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it more.

     

  • Dave Wi Profile Picture
    on at

    Hi @v-jefferni 

     

    Thank you for your attention!

     

    Do you want to patch the CustomField1 to the User entity? - Yes by individual user.

     

    If you do, the Patch formula should be: - I have used the same formula as mentioned in the original post against Users Collection.However it's not working, I assume that's because records are more than 2000, and filter could work only on 2000 records at time?

     

    Patch( Users, First( Filter(Users, 'Primary Email' = User().Email )), { CustomField1: "Testing" }))

     

    The Patch functions works in syntax like Patch( DataSource, BaseRecord, ChangeRecord1 [, ChangeRecord2, … ]), the BaseRecord you want to modify should be in the data source. - Yes, that's why I have applied the similar formula which is not working

     

    You created a collection “CollUsers”, could you please share more details about your scenario? Collections collect one or many records form data sources, but store them temporarily. Modify a collection won’t affect the records in data source even if they are totally same. - There are more than 5000+ user records, I think I require to know how to filter large records - any clue? because when I filter records from first 2000, the same formula works, but not more than 2000 records that is what I am experiencing.

     

    Thanks,

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @dave8 ,

     

    Since the Users entity contains more than 2000 records, there would be delegation issues with the function First() and the User().Email condition.

     

    To avoid the delegation issue, create a global variable of user's email address with below formula on the log in or first screen.

     

    Set(CurrentUserEmail,User().Email)

     

    And the formula need to be modified to:

     

    Patch( Users, LookUp(Users, 'Primary Email' = CurrentUserEmai), { CustomField1: "Testing" }))

     

     

    Hope it helps.

     

    Best regards,
    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution  to help the other members find it more.
  • Dave Wi Profile Picture
    on at

    Hi,

     

    This is awesome, It worked for me the way I wanted 🙂

     

    Thank you so much!

     

    Regards

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard