cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Patch - Create new record username and email of current logged in

Hi all,

 

How can I add username and email address of the current user logged in to a SharePoint list the Patch() function? This is what I have so far: 

 

Patch(dataSource, Defaults(dataSource),{Employee: {'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"i:0#.f|membership|" & Lower(User().Email), Department:"",  DisplayName:User().FullName,  Email:User().Email,  JobTitle:".",  Picture:"."}})

 Any help is appreciated

 

Thanks

2 REPLIES 2
Community Support
Community Support

Hi @_sourcecod3_ ,

 

First of all, your formula only contains one Employee field, is it the only Required field in your SharePoint list? You have to include all the Required fields in Patch. 

 

Secondly, please change the field formula to:

 

{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & Lower(User().Email),
Department:"",
DisplayName:User().FullName,
Email:User().Email,
JobTitle:"",
Picture:""
}

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-monli-msftso that's what I'm confused with, how do I add the email address and update the column in the SharePoint list?

 

Thanks

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (44,541)