Hi,
I have added a Person or Group field in a SharePoint Online List (also exposed through Team/Microsoft Lists) and I want the current user is the default value. How can I achieve this?
Thanks,
John
Hi,
I have added a Person or Group field in a SharePoint Online List (also exposed through Team/Microsoft Lists) and I want the current user is the default value. How can I achieve this?
Thanks,
John
@JohnDoe-3825, Do you have any update on this iusse?
If an answer helps you, please remember to accept it as answer via the "Accept Answer" button. :-)
@JohnDoe-3825,
Would you tell me whether your issue has been resolved or have any update ?
I am looking forward to your reply.
If your SharePoint Online Site is using classic experience then you could use below JavaScript for your requirement:
If your SharePoint Online site is using Modern Experience then you could do it using PowerApps, below article will help to do via PowerApps.
Thanks & Regards,
Hi @JohnDoe-3825,
Which version of experience are you applying to your SharePoint Online list, modern experience or classic experience?
If you are using modern experience, please refer to the following steps:
1) Go to your list->Power Apps->Customize forms:

2) Click FormScreen1 on the left Tree view->Advanced on the right->OnVisible->fill the text box with following code:

UpdateContext({
CurrentUser: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(User().Email),
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle: ".",
Picture: "."
}
})
3) Click the people or group field DataCard(which is named Name_DataCard1 in my example) on the left Tree view:

Go to Advanced on the right and click on unlock to change properties->fill the variable to “CurrentUser” in the Default column as shown below:

4) Save the form and publish it to SharePoint. Then you can see the people or group field has been populated with the current user when you “New” item in your list.
If you are using classic experience, please refer to this article to use JS code to meet your needs:
SharePoint Online: Set Current User as Default Value in Person or Group Field
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
I hope this information has been useful, please let me know if you still need assistance.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
This should include a Form.Mode check to see if it’s a new record or not before applying. Thx.
Maybe using Power Automate and "On new list Item" copy created by into your people field?
8 people are following this question.
Not abe to create a folder in Sharepoint Site
Custom DLL Deployment in SharePoint Online
How to get sharepoint site group name using Graph API?
Need Script to read list of SPO sites from excel and get owners and members list as in csv OutPut
Regarding the SharePoint Online List formatting (Document Library)