locked
Sharepoint 2007 - how to default curent user to the people and group field? RRS feed

  • Question

  • Hi

    Is there an easy way from Sharepoint that i can default curent  user to the people and group field?

     

    Please advise.


    Thanks.

    Wednesday, November 2, 2011 12:50 PM

Answers

  • Hi,

    We can achieve this by a simple workflow. First of all, select No in “Required this column contain information” when create the list column. Then you can follow these steps:
    1.    
    Create a workflow for the list, and choose “Automatically start this workflow when a new item is created”.
    2.      
    Set the condition that if the field is empty, choose Update List Item in Actions, and set the people and group field as Modified By or Created By.



    3.      
    After creating the workflow, if you haven’t added users in the people and group field when create a new item, it shows the current user automatically. And if you have users pre-field in the field, it won’t change the pre-filled users to current user.

    Another solution, you can get current user via JavaScript, here is a link you can refer to (It applies to SharePoint 2010, and similar in SharePoint 2007):
    http://sharepointgauravgoyal.blogspot.com/2011/04/set-default-value-for-people-picker-via.html

    Thanks,
    Emir

    • Marked as answer by Emir Liu Friday, November 11, 2011 9:55 AM
    Thursday, November 3, 2011 9:40 AM

All replies

  • people and group field for a list column?

    Then, yes - use [ME] as the default value.


    Regards | Aaron www.aaron-rendell.co.uk | SharePoint Consultant | Microsoft Gold Partner - Silversands, Poole, Dorset, England
    • Proposed as answer by Ivan Sanders Saturday, November 5, 2011 9:38 AM
    Wednesday, November 2, 2011 1:47 PM
  • Hi Aaron,

    Thanks for your reply...

    Yes... it's people and group field for a list column.  I dont see any where that i can set the default value for it..

    At Create Column:  I select Person or group

    At Additional Column settings, there are:

    Required this column contain info, I select Yes

    Allow multiple selections: i select people only

    Choose from :  I select All users

    Show field: Name

    And that is it... there is no place that allow me to set the default value...

    Please advise.  thanks.

    Wednesday, November 2, 2011 3:22 PM
  • Hi,

    We can achieve this by a simple workflow. First of all, select No in “Required this column contain information” when create the list column. Then you can follow these steps:
    1.    
    Create a workflow for the list, and choose “Automatically start this workflow when a new item is created”.
    2.      
    Set the condition that if the field is empty, choose Update List Item in Actions, and set the people and group field as Modified By or Created By.



    3.      
    After creating the workflow, if you haven’t added users in the people and group field when create a new item, it shows the current user automatically. And if you have users pre-field in the field, it won’t change the pre-filled users to current user.

    Another solution, you can get current user via JavaScript, here is a link you can refer to (It applies to SharePoint 2010, and similar in SharePoint 2007):
    http://sharepointgauravgoyal.blogspot.com/2011/04/set-default-value-for-people-picker-via.html

    Thanks,
    Emir

    • Marked as answer by Emir Liu Friday, November 11, 2011 9:55 AM
    Thursday, November 3, 2011 9:40 AM