I'm doing an
SPQuery on the
'Modified By' (Editor) column of a
While my SharePoint list displays names like
#Doe, John, my query result for this column is
1;#Doe John. Where does the
1; come from ?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
It is the default SharePoint behavior.
When you get any user value field from the list, it will return always in this format:
;# is the delimiter to separate the username which is
Doe John and
1 is the ID of the username for that site.
Look at the below code for example:
SPFieldUserValue userValue = new SPFieldUserValue(web, item["Editor"].ToString()); SPUser author = userValue.User;
Above code gets the whole value (
1:#Doe John) in
SPFieldUserValue object and parse the value to get other details of the user like login name, email etc..
Hope this helps!