4

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?

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

2 Answers 2

3

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.

4
  • I've never thought to output it, I'll try that and see what goodies lie within. May 28, 2011 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? May 31, 2011 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. Jun 1, 2011 at 3:20
  • Thanks for looking at it, time to Bing away, hopefully this will get some up votes and a little more attention. Jun 1, 2011 at 12:13
2

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 and acknowledge you have read our privacy policy.

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