Forum Discussion

Djeanthi2215's avatar
Djeanthi2215
Copper Contributor
Jan 29, 2024

How to copy the user name to a field of Sharepoint list who creates the item of this list

Hi Team ,

 

Please let me know how to copy the user name to a field of the SharePoint list who creates this item.

 

Thank you!

 

Djeanthi 

    • Djeanthi2215's avatar
      Djeanthi2215
      Copper Contributor

      NicolasKheirallah 

       

      In a SharePoint list with fields Emp-name (text type), Start-Date, End-Date, and Description (text type), I would like to automatically set the default value of the Emp-name field to the user's email address when they add a new item to the list.

       

      For example:

       

      Upon entering the item, the Emp-name field should automatically populate with the respective user's email address, creating a record like this:

       

      Emp-name                          Start-Date         End-Date     Description
      email address removed for privacy reasons    jan1                  jan 14         workded on the first page of the app
      email address removed for privacy reasons    jan6                  jan 20          troubleshooted the app

       

       

      Thank you!

       

      Djeanthi

      • ganeshsanap's avatar
        ganeshsanap
        MVP

        Djeanthi2215 SharePoint provides the Created By column in the list by default which shows the name of person who created the list item, you can add it to list view like: 

        Check detailed steps to add the column to list view at: Show or hide columns in the SharePoint list 

         

        If you don't want to use the SharePoint default created by column and still want to auto-populate the text field so that it can be edited later by someone else, you have below options:

        1. Power Apps: Customize the SharePoint list forms using Power Apps and auto populate the text field based on currently logged in user. You can get the currently logged in user details using User() function in Power Apps. Check:
        2. Power Automate: Create a Power automate flow which will run when new item is created and use "Update item" action in Power automate flow to update the text field based on Created By Display name from dynamic content. Note: It will take some time to update the list view with the user name (until flow runs).

        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources