6

Having some trouble finding a list of these variables. Any help would be greatly appreciated. More specifically, when I see this on the page:

<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>

I want to know what other CAMLVariable exist. This also of course includes ServerVariables as well.

2
  • @Mike T: Can you please explain a little more about what you mean here? How are you trying to use these variables?
    – Alex Angas
    Commented Jan 28, 2010 at 22:29
  • When editing the xslt in many of the SharePoint's pages, there are references to these variables. I am trying to find more information about them.
    – Mike T
    Commented Feb 4, 2010 at 18:28

4 Answers 4

1

Query schema: http://msdn.microsoft.com/en-us/library/ms467521.aspx

5
  • @Mike T, Setting up IntelliSense for CAML in Visual Studio may be a help, too: msdn.microsoft.com/en-us/library/bb507730.aspx @next_con, I've pretty much exclusively used either U2U CAML Query Builder or SharePoint Manager 2007 to get my CAML for SPQuery...please let me know if you think of the other tool you had in mind!
    – Anonymous
    Commented Feb 2, 2010 at 18:23
  • I have started to use these as well. The link is a good one. However, I still would like to have a reference to ServerVariables.
    – Mike T
    Commented Feb 4, 2010 at 18:26
  • Maybe I'm just being daft, but does this page actually contain a list of CAML Variables? I can't actually find, for example, PageUrl or HttpVDir, which are both included as parameters in standard DVWP definitions.
    – Dexter
    Commented Jul 25, 2011 at 9:52
  • 1
    @Dexter, I don't see either how the accepted answer actually answered the OP question. Where are these elusive CAMLVariables actually defined?
    – MdMazzotti
    Commented Jan 23, 2014 at 15:19
  • @MdMazzotti, excellent point - I dont think that this question has been answered, by either this answer or others on the page. There is a list of Server Variables here: msdn.microsoft.com/en-us/library/ms524602.aspx (instructions for using them are in Marc D Anderson's answer below), but I still haven't found a source describing the CAML variables.
    – Dexter
    Commented Jan 24, 2014 at 1:28
5

Here's the reference to Server Variables from my blog: http://mdasblog.wordpress.com/2007/10/19/data-view-web-part-parameters-based-on-server-variables/

1
  • Thanks Marc don't know what I was thinking accepting that other one as an answer, yours and Jaap's are the most useful replies.
    – BinaryJam
    Commented Apr 17, 2014 at 8:26
1

I can't provide you with a list of CAMLVariables, but here is an interesting link that demonstrates a trick that allows you to be extremely flexible with regards to the values being passed into your ParameterBindings.

3
  • I just posted the same answer as above on your interesting link, Jaap. Server Variables are going to be easier to work with than that trick, IMHO. Commented Feb 7, 2010 at 14:32
  • You are right when we only need the URL variable, but the stackoverflow answer provided at the url in my answer above shows a menthod that is not limited to the available Server Variables. You could construct ANY string in your C# code and "inject" it. Commented Feb 7, 2010 at 15:11
  • Thanks Jaap don't know what I was thinking accepting that other one as an answer, yours and Marcs are the most useful replies.
    – BinaryJam
    Commented Apr 17, 2014 at 8:26
0

There is another reference I can't seem to find now, but it helps to build and test your queries in something like Stramit CAML Viewer or U2U CAML Creator.

1
  • thanks mike use this all the time, the old u2u tool, cant stand the newer version.
    – BinaryJam
    Commented Apr 17, 2014 at 8:25

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.