cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Save the current user using the powerapp in a sharepoint list.

In my screen, I want user to choose date and save.

But I want to save departmentname , username ,team , date (follow user pick).

Noona_2-1629775451902.png

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

Noona_1-1629775290091.png

Please guide me about it.

 

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Anonymous ,

Run this at App OnStart

Set(gblUser,Office365Users.MyProfileV2())

You can then refer to the bits you want (example)

gblUser.department

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Anonymous
Not applicable

@WarrenBelz  How to use patch on select for choose date picker and save in MS list?

Noona_0-1629978628505.png

 

 

@Anonymous ,

Can you please post the code you have tried (in Text)

v-bofeng-msft
Community Support
Community Support

Hi @Anonymous :

I assume username is a person column which do not allow multiple selections:

vbofengmsft_1-1630467447363.png

If so,please try this formula:

With(
  {TheUser:Office365Users.MyProfileV2()},
  Patch(
     WFH,
     Defaults(WFH),
     {
       Title:"1",
       username:
        { 
         '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
         DisplayName:TheUser.displayName,
         Claims:"i:0#.f|membership|" & TheUser.mail,   
         Email:TheUser.mail,
         Department:TheUser.department,
         JobTitle:TheUser.jobTitle,
         Picture:User().Image
         },
      Date:DatePicker1.SelectedDate
     }
   )
)

vbofengmsft_2-1630468196843.png

Best Regards,

Bof

 

 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (3,125)