Question

I am targeting a Person/Group field within my page layout via JavaScript. This enables me to get the display name for that particular user "Lastname, Firstname".

Using '.innerHTML', I can also retrieve the email address for that user. I am wondering if I can use the "Lastname, Firstname" to lookup that particular user's account name for use elsewhere.

I have already found examples of where I can lookup various user profile properties given that my input is the account name. However I don't have this available to me and this is the property I need to retrieve.

Was it helpful?

Solution

Use SPServices for this. You can pass the lastname / first name and get the user object using which you can fetch user properties. See: http://spservices.codeplex.com/wikipage?title=SearchPrincipals

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top