Query Properties

Default Query

The default query that will be used if variables come back null and the variable default is set to CWBlankFilter.

QueryParameter

Used to control the posted input of a Query (?CAML=…Query…)

Example:             CAML

Query Lists

Controls the type of lists returned.

Example:             <Lists BaseType="1" MaxListLimit="0"/>

Attributes

•    ServerTemplate – Limits the query to lists of the specified server template.

•    BaseType – Limits the query to lists of a specified base type.

0 – Generic List

1 – Document Library

3 – Discussion Forum

4 – Vote or Survey

5 – Issues List

•    Hidden – Determines if lists that are hidden are returned. (Options: TRUE/FALSE)

•    MaxListLimit – Controls the maximum amount of lists queried. If set to 0, then no limit is specified. The default is 1000.

List Sub Element

If you would like to return specific lists, use <List ID=""/> for each list to be returned. A maximum of 10 may be consumed in this way.

Example:

<Lists>

 <List ID="7A9FDBE6-0841-430a-8D9A-53355801B5D5" />

 <List ID="3D18F506-FCA1-451e-B645-2D720DC84FD8" />

</Lists>

WithIndex Sub Element

If you would like to only return lists that have a specific index field, specify each index field within the Lists elements.

•    FieldID – The ID of the field

•    Type – Type of field (Must be "Text")

•    Value – Value the field should contain.

Example:

 <WithIndex FieldId="D4819257-6B69-41F1-82C8-A91615BFF500" Type="Text" Value="Complete" />

Query Row Limit

The maximum number of items returned.

Example:

500

Query Template

A template CAML used for filtering. If you would like to specify a URL parameter that is used within the CAML template, specify the parameter name with [% … %] characters around it. To specify a default value, separate the parameter name and the default value with a pipe character. To use a different CAML filter, specify the value CWBlankFilter and fill in the Default Query property with the CAML to be used.

Example 1:  

<Where><Eq><FieldRef Name="Title"/><Value Type="Text">[%SearchText|Task%]</Value></Eq></Where>

Example 2:  

<Where><Eq>

<FieldRef Name="Title"/><Value Type="Text">[%SearchText|CWBlankFilter%]</Value></Eq></Where>

 

If you would like to specify a Cookie Name that is used within the CAML template, specify the parameter name with [:…:] characters around it. To specify a default value, separate the parameter name and the default value with a pipe character. To use a different CAML filter, specify the value CWBlankFilter and fill in the property Default Query with the CAML to be used.

Example 1:  

<Where><Eq><FieldRef Name="Company"/><Value Type="Text">[:Company|CorasWorks:]</Value></Eq></Where>

Example 2:  

<Where><Eq>

<FieldRef Name="Title"/><Value Type="Company">[:Company |CWBlankFilter:]</Value></Eq></Where>

 

Query View Fields

This controls the columns that will be returned. If you say Nullable = false, then the column must exist in the list in order to be retrieved (just like our schema). (This does not support Multi Lookup & Person/Group Fields)

Example:

<FieldRef Name="FileRef" Nullable="TRUE" /><FieldRef Name="LinkFilename" Nullable="TRUE" /><FieldRef Name="FileLeafRef" Nullable="TRUE" />

Query Webs

The web sites to include in the query as specified by the Scope attribute on the Webs tag in the query. By default, the query considers the current web site as the starting web site. Possible values of the Scope attribute include Recursive and SiteCollection. When the Scope attribute is set to Recursive, the query considers all Web sites that are descended from the current site.

Example:

<Webs Scope="Recursive" />