locked
How to get "Person or Group" type column as a look up column in another list? RRS feed

  • Question

  • There is a list say list1 which has a column person name which is a Person or group column type.
    Another list say list2 needs a column populated with the set of values from person name column in list1. Person or Group type columns are not available for look up fields.

    I am thinking of following approach:
    Create a choice column in list2
    Populate the choices using event handler or custom workflow.

    Please let me know if any best approaches are there?
    Wednesday, February 25, 2009 3:27 PM

Answers

  • Thank you Jaimin and Amit.

    Amit, I derived another workaround from your suggestion.

    Add another field of type 'Single line of text' say UName.
    Add a sharepoint workflow to update the field UName.
    Use the UName as a lookup filed in the second list.


    • Marked as answer by Loge V Tuesday, March 3, 2009 11:02 AM
    Tuesday, March 3, 2009 11:01 AM

All replies

  • Hi Loge,

    In SharePoint there is a control PeoplePicker which will give you the values you need.
    e.g. You created a PeoplePicker control in code namely ppEmployee the following code will help you:

    foreach(PickerEntity pe in ppEmployee.Entities)
    {
        string empId = pe.Key;
        //insert the employee id in the next list, also check for other properties as per your requirement.
    }

    In essence PeoplePicker is the control which handles Person or Group column type.

    Let me know in case of any other queries.

    Thanks and Regards,
    Jaimin Kansara

    Monday, March 2, 2009 5:17 PM
  • Hi Loge

    You can also create another column in List1 say UserName of type text. Attach ItemAdding event handler to the List1 which will add selected person in UserName field.

    Use UserName field for your lookup.


    Amit
    Monday, March 2, 2009 5:57 PM
  • Thank you Jaimin and Amit.

    Amit, I derived another workaround from your suggestion.

    Add another field of type 'Single line of text' say UName.
    Add a sharepoint workflow to update the field UName.
    Use the UName as a lookup filed in the second list.


    • Marked as answer by Loge V Tuesday, March 3, 2009 11:02 AM
    Tuesday, March 3, 2009 11:01 AM