SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a requirement that I have to get the list item values in SharePoint list item updating event. In that I am getting list item properties( current properties ) and also updated values( after properties ), except the people picker value.

as that

string cuurentUser= properties.ListItem["User"].ToString();
( Result: "22;#RAMPINDIA/ventew")
string afterUser= properties.AfterProperties["PermissionLevel"].ToString(); (Result:"22")

as shown above I am just getting the ID only.

Can any one help me to find the way to find the entire name?

share|improve this question
Based on your sample, it would seem that you aren't reading the before and after values from the same field... Is that right? – SPArchaeologist Dec 15 '11 at 14:35
yes, in after properties iam reading all fields except the people picker value... – suresh Dec 16 '11 at 3:49

If you are accessing to lookup field in AfterProperties, you always get only lookup id. User field is also lookup to User Information List, so you must get user using GetById(int ID) as @Stuart Pegg suggests. But there are some pitfalls when you accessing to lookup fields in event receivers, I've posted about this pitfalls in my blog, check it out:

Accessing SharePoint lookup fields values in item receivers - some pitfalls
Working with SPFielduserValue in item event receivers - some pitfalls

share|improve this answer

I believe you should be able to use the SPWeb.AllUsers.GetById(int ID) method to get the SPUser for that ID, and then use that object's properties to get the required information:

MSDN: SPUserCollection.GetByID Method

MSDN: SPUser Members

Also, you can use SPFieldUserValue(SPWeb, string) constructor to get an SPFieldUserValue object from your current properties string, and use SPFieldUserValue.User to get an SPUser object. More details on using SPFieldUserValue can be found on my blog:

TssTssT: Easily accessing Lookup and User fields

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.