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 to pass in the email address of the current user to a web service data source (run time) of a DataForm Web Part.

My Question is:

a) How can I get Email address of a user based on login in DVWP? I know we can get the CurrentUser using the CurrentUserName but how do we get the Email for the Current User.

b) After getting the Email how to we pass to the Web Service runtime?

Note: In XSL

share|improve this question
Have you subclassed the DVWP? – Steve P Oct 12 '10 at 5:58

This might help:

share|improve this answer
+1 for linking to my article :-) – Eric Alexander Jul 28 '11 at 13:50

Embedding all of that in xsl is pretty painful. Your best bet is to use something like SPServices (jQuery) which has a GetCurrentUser function and put it on the page with the DVWP. The script can get the current user, call a web service, and even update the contents of the DVWP if needed.

share|improve this answer

I tried the SPSerives route on the master page that for some reason did not work for me. I took the server side approach wrote a custom control to get it working. Deployed the custom control project replaced <cc2:DataFormParameter ParameterKey="username" PropertyName="ParameterValues" DefaultValue="abc" Name="username"></cc2:DataFormParameter> with the new tag for the custom control <abc:UserProfileParameter PropertyName="WorkEmail" DefaultValue="abc" Name="UserEmailAddress"></abc:UserProfileParameter> within the SelectParameter in Data source String in the .webpart file. This way I got the user profile information pass to the web service.

share|improve this answer

Your Answer


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