XSLT get email address from person field
Chris McKinley | March 4, 2010In this brief post I will show you how to use xslt to get someone’s email address from the people picker in a SharePoint list. Before I begin I must give credit to David Botschinsky who I met at the BETT show in January. He came to me and asked about getting the email address of a person from the person lookup field in a list – He wanted to achieve this purely through the browser if possible with no code. I had a quick think and couldn’t find a way. I then received an email from David saying he did it through SharePoint designer in the end and it’s this I will share with you:
In SPD create a XSLT view of the list with the person field in. The usual <xsl:value-of select=’@person’ disable-output-escaping=”yes” /> code will return the familiar link that goes to the user information page. By changing the ‘disable-output-escaping’ to ‘no’ you will return all the code behind this link- including the email address! Then with some xslt sub-string magic you can strip out all but the email address.
<xsl:value-of select= 'substring-before(substring-after(@person, concat("sip=",$dvt_apos)), $dvt_apos)' disable-output-escaping="no"/>
That is all there is to it!








