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 / Save the current user ...
Power Apps
Answered

Save the current user using the powerapp to a person column in a sharepoint list.

(1) ShareShare
ReportReport
Posted on by 293

Hi, currently working in an App to registry tasks from a group of users using a SharePoint list as a database.

 

The idea would be that an User column of the list automatically gets the user profile of the the one using the app to save a new element (task).

 

I thought this would be as simple as put MyProfile() using the O365 connector as default value in the User column but to my surprise as a Person column is basically a lookup column when you save a new element, even when you can see the displayname of the user selected to go into the column, this would save as empty! 

 

As a workaround I used a Singleline text value to save the displayname of the user with it's default property and it worked fine.

 

But as I'm moving forward with the app now I want to make a gallery to filter the task list and it would be nice to use the user profile properties as photo, e-mail, etc. and I can't since I don't have the profile anywhere.

 

Is there a way to auto-save a user profile into a person column?

 

 

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

    Hi @FacundoGorla ,

    Can you share more details with your apps? when do you want to patch the User to SP list?

    If you want to patch user to Person column, please refer to the following formula:

    Patch('SP list', First('SP list'), {User:{Claims:"i:0#.f|membership|" & User().Email,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""}})

    This formulas is to patch current user to User column of first item. please have a try and check if your issue is fixed.

    Best regards,

    Sik

    If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

  • FacundoGorla Profile Picture
    293 on at

    Hi, thanks por the response. The user fill a form to create a new "task" that saves in the SharePoint list.

    I have the column "User" as not visible and the default value of the datacard is "UsuariosdeOffice365.MyProfile()" wich autoselects the profile of the user using the app, but when it saves the form this value does not save into the user column.

     

    I would like to patch the column when the user saves the form so I'll put it in the saving button.

    Right now I was making it work with a text column that saves the user's ID so later if I need to get any user info I would use a function that ask for the ID for example "UsuariosdeOffice365.userphoto(ID)"

     

     

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @FacundoGorla ,

     

    The column of table that UsuariosdeOffice365.MyProfile() function return is different from the person column in SharePoint, so you shouldn't submit the UsuariosdeOffice365.MyProfile() to Person column directly.

    The person column contains Claims, Department, DisplayName, Email, JobTitle, Picture columns. so if you want to submit the current user to it,  please put the following formulas to Update property of user Datacard.

     

    {Claims:"i:0#.f|membership|" & User().Email,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""}

     

    Note: you can use User().Email to get the current login user's email.

    Please have a try and check if your issue is fixed. if not ,please post back the error detail.

    Best regards,

    Sik

    If my post is helpful for you, please click on “Accept as Solution” to help other members find it more quickly.

  • FacundoGorla Profile Picture
    293 on at

    Sorry if it's a dumb question but what do I put in the default property?

    Already changed the Update.

     

    EDIT: didn't put anything and it worked using the Update property as you suggested. Great solution so far.

    Another doubt is if the values of the user propoerties are going to be usable and with the correct info of the user?

     

    For example Department that I leave "" in the Update property will have the correct data of the user?

  • shal2522 Profile Picture
    76 on at

    Instead of the current login user's ID how do we indicate to take the user name selected in the dropdown

     

    {Claims:"i:0#.f|membership|" & User().Email,Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""}

     

     in the below code 

  • Kumar_bi Profile Picture
    190 on at

    @FacundoGorla hi sir , you said "As a workaround I used a Singleline text value to save the displayname of the user with it's default property and it worked fine." Is is just with a single patch command on a click of button ?

     

    Also , how can i associate a form that is on my next screen to this ?

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