I have a question sort of related to this post. The default value of the CAML variable UserID is the CurrentUserName. Can that be set to different properties or is that fixed? For example, could you make it return the user id from the User Information List?

  • Eric: Do you mean strictly in a DVWP or are you thinking more broadly? – Marc D Anderson May 28 '11 at 4:29
  • In this case, I'm refering to in a DVWP specifically. – Eric Alexander May 28 '11 at 11:33

UserID is simply a parameter which is bound to the CurrentUser CAML variable. SharePoint Designer creates this binding for you whenever you add a DVWP to a page.

UserID actually contains more information than just the name, but SharePoint interprets it differently depending on the context. If you output the value it contains with xsl:value-of, you'll see all of the details.

  • I've never thought to output it, I'll try that and see what goodies lie within. – Eric Alexander May 28 '11 at 23:52
  • I've dumped it and it's just showing last name, first name in every instance I've tried. Is there a trick to making it dump it's entire contents? Or is that what you mean by it being dependant on the context? – Eric Alexander May 31 '11 at 20:48
  • I just tried it and see the same thing as you. I could have sworn it worked differently the last time I looked at it. I also can't find ANYTHING on MSDN to help. Sorry. – Marc D Anderson Jun 1 '11 at 3:20
  • Thanks for looking at it, time to Bing away, hopefully this will get some up votes and a little more attention. – Eric Alexander Jun 1 '11 at 12:13

I'm going to answer this as this is the only outcome, last name, first name. If anyone comes across any other definitive information on this and ways to output it, I'll unmark this as the answer and award them the points.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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