Class CamlBuilder

Index

Enumerations

Interfaces

Classes

Constructor methods

Methods

Enumerations

DateRangesOverlapType: DateRangesOverlapType

public Day: DateRangesOverlapType

Returns events for one day, specified by CalendarDate in QueryOptions

public Month: DateRangesOverlapType

Returns events for one month, specified by CalendarDate in QueryOptions. Caution: usually also returns few days from previous and next months

public Now: DateRangesOverlapType

Returns events for today

public Week: DateRangesOverlapType

Returns events for one week, specified by CalendarDate in QueryOptions

public Year: DateRangesOverlapType

Returns events for one year, specified by CalendarDate in QueryOptions

Interfaces

IBooleanFieldExpression: IBooleanFieldExpression

public EqualTo(value: boolean): IExpression

Checks whether the value of the field is equal to the specified value

Parameters

  • value: boolean

Returns

IExpression

public IsFalse(): IExpression

Checks whether the value of the field is False

Returns

IExpression

public IsNotNull(): IExpression

Checks whether the value of the field was not specified by user

Returns

IExpression

public IsNull(): IExpression

Checks whether the value of the field was specified by user

Returns

IExpression

public IsTrue(): IExpression

Checks whether the value of the field is True

Returns

IExpression

public NotEqualTo(value: boolean): IExpression

Checks whether the value of the field is not equal to the specified value

Parameters

  • value: boolean

Returns

IExpression

IDateTimeFieldExpression: IDateTimeFieldExpression

public EqualTo(value: Date): IExpression

Checks whether the value of the field is equal to the specified value

Parameters

  • value: Date

Returns

IExpression

public EqualTo(value: string): IExpression

Checks whether the value of the field is equal to the specified value. The datetime value should be defined in ISO 8601 format!

Parameters

  • value: string

Returns

IExpression

public GreaterThan(value: Date): IExpression

Checks whether the value of the field is greater than the specified value

Parameters

  • value: Date

Returns

IExpression

public GreaterThan(value: string): IExpression

Checks whether the value of the field is greater than the specified value. The datetime value should be defined in ISO 8601 format!

Parameters

  • value: string

Returns

IExpression

public GreaterThanOrEqualTo(value: Date): IExpression

Checks whether the value of the field is greater than or equal to the specified value

Parameters

  • value: Date

Returns

IExpression

public GreaterThanOrEqualTo(value: string): IExpression

Checks whether the value of the field is greater than or equal to the specified value. The datetime value should be defined in ISO 8601 format!

Parameters

  • value: string

Returns

IExpression

public In(arrayOfValues: Array<Date>): IExpression

Checks whether the value of the field is equal to one of the specified values

Parameters

  • arrayOfValues: Array<Date>

Returns

IExpression

public In(arrayOfValues: Array<string>): IExpression

Checks whether the value of the field is equal to one of the specified values. The datetime value should be defined in ISO 8601 format!

Parameters

  • arrayOfValues: Array<string>

Returns

IExpression

public IsNotNull(): IExpression

Checks whether the value of the field was not specified by user

Returns

IExpression

public IsNull(): IExpression

Checks whether the value of the field was specified by user

Returns

IExpression

public LessThan(value: Date): IExpression

Checks whether the value of the field is less than the specified value

Parameters

  • value: Date

Returns

IExpression

public LessThan(value: string): IExpression

Checks whether the value of the field is less than the specified value. The datetime value should be defined in ISO 8601 format!

Parameters

  • value: string

Returns

IExpression

public LessThanOrEqualTo(value: Date): IExpression

Checks whether the value of the field is less than or equal to the specified value

Parameters

  • value: Date

Returns

IExpression

public LessThanOrEqualTo(value: string): IExpression

Checks whether the value of the field is less than or equal to the specified value. The datetime value should be defined in ISO 8601 format!

Parameters

  • value: string

Returns

IExpression

public NotEqualTo(value: Date): IExpression

Checks whether the value of the field is not equal to the specified value

Parameters

  • value: Date

Returns

IExpression

public NotEqualTo(value: string): IExpression

Checks whether the value of the field is not equal to the specified value. The datetime value should be defined in ISO 8601 format!

Parameters

  • value: string

Returns

IExpression

IExpression: IExpression

public And(): IFieldExpression

Adds And clause to the query.

Returns

IFieldExpression

public GroupBy(fieldInternalName: any): IGroupedQuery

Adds GroupBy clause to the query.

Parameters

  • fieldInternalName: any

Returns

IGroupedQuery

public Or(): IFieldExpression

Adds Or clause to the query.

Returns

IFieldExpression

public OrderBy(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (ascending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public OrderByDesc(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query (using descending order for the first field).

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (descending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public ToString(): string

Get the resulting CAML query as string

Returns

string

IFieldExpression: IFieldExpression

public All(conditions?: IExpression[]): IExpression

Adds And clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression().

Parameters

Returns

IExpression

public All(conditions: IExpression[]): IExpression

Adds And clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression().

Parameters

Returns

IExpression

public Any(conditions?: IExpression[]): IExpression

Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression().

Parameters

Returns

IExpression

public Any(conditions: IExpression[]): IExpression

Adds Or clauses to the query. Use for creating bracket-expressions in conjuction with CamlBuilder.Expression().

Parameters

Returns

IExpression

public BooleanField(internalName: string): IBooleanFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Boolean

Parameters

  • internalName: string

Returns

IBooleanFieldExpression

public CounterField(internalName: string): INumberFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Counter (usually ID fields)

Parameters

  • internalName: string

Returns

INumberFieldExpression

public DateField(internalName: string): IDateTimeFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Date

Parameters

  • internalName: string

Returns

IDateTimeFieldExpression

public DateRangesOverlap(overlapType: DateRangesOverlapType, calendarDate: string, eventDateField?: string, endDateField?: string, recurrenceIDField?: string): IExpression

Used in queries for retrieving recurring calendar events. NOTICE: DateRangesOverlap with overlapType other than Now cannot be used with SP.CamlQuery, because it doesn't support CalendarDate and ExpandRecurrence query options. Lists.asmx, however, supports them, so you can still use DateRangesOverlap with SPServices.

Parameters

  • overlapType: DateRangesOverlapType

    Defines type of overlap: return all events for a day, for a week, for a month or for a year

  • calendarDate: string

    Defines date that will be used for determining events for which exactly day/week/month/year will be returned. This value is ignored for overlapType=Now, but for the other overlap types it is mandatory.

  • eventDateField?: string optional

    Internal name of "Start Time" field (default: "EventDate" - all OOTB Calendar lists use this name)

  • endDateField?: string optional

    Internal name of "End Time" field (default: "EndDate" - all OOTB Calendar lists use this name)

  • recurrenceIDField?: string optional

    Internal name of "Recurrence ID" field (default: "RecurrenceID" - all OOTB Calendar lists use this name)

Returns

IExpression

public DateTimeField(internalName: string): IDateTimeFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is DateTime

Parameters

  • internalName: string

Returns

IDateTimeFieldExpression

public IntegerField(internalName: string): INumberFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Integer

Parameters

  • internalName: string

Returns

INumberFieldExpression

public LookupField(internalName: string): ILookupFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Lookup

Parameters

  • internalName: string

Returns

ILookupFieldExpression

public LookupIdField(internalName: string): INumberFieldExpression

DEPRECATED. Please use LookupField(...).Id() instead

Parameters

  • internalName: string

Returns

INumberFieldExpression

public LookupMultiField(internalName: string): ILookupMultiFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is LookupMulti

Parameters

  • internalName: string

Returns

ILookupMultiFieldExpression

public NumberField(internalName: string): INumberFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Number

Parameters

  • internalName: string

Returns

INumberFieldExpression

public TextField(internalName: string): ITextFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Text

Parameters

  • internalName: string

Returns

ITextFieldExpression

public UrlField(internalName: string): ITextFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is URL

Parameters

  • internalName: string

Returns

ITextFieldExpression

public UserField(internalName: string): IUserFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is User

Parameters

  • internalName: string

Returns

IUserFieldExpression

public UserMultiField(internalName: string): ILookupMultiFieldExpression

Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is UserMulti

Parameters

  • internalName: string

Returns

ILookupMultiFieldExpression

IFinalizable: IFinalizable

public ToString(): string

Get the resulting CAML query as string

Returns

string

IGroupable: IGroupable

public GroupBy(fieldInternalName: any): IGroupedQuery

Adds GroupBy clause to the query.

Parameters

  • fieldInternalName: any

Returns

IGroupedQuery

public OrderBy(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (ascending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public OrderByDesc(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query (using descending order for the first field).

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (descending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public ToString(): string

Get the resulting CAML query as string

Returns

string

IGroupedQuery: IGroupedQuery

public OrderBy(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (ascending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public OrderByDesc(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query (using descending order for the first field).

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (descending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public ToString(): string

Get the resulting CAML query as string

Returns

string

ILookupFieldExpression: ILookupFieldExpression

public Id(): INumberFieldExpression

Specifies that lookup id value will be used.

Returns

INumberFieldExpression

public ValueAsBoolean(): IBooleanFieldExpression

Specifies that lookup value will be used and this value is of type Boolean

Returns

IBooleanFieldExpression

public ValueAsDate(): IDateTimeFieldExpression

Specifies that lookup value will be used and this value is of type Date

Returns

IDateTimeFieldExpression

public ValueAsDateTime(): IDateTimeFieldExpression

Specifies that lookup value will be used and this value is of type DateTime

Returns

IDateTimeFieldExpression

public ValueAsNumber(): INumberFieldExpression

Specifies that lookup value will be used and this value is of type Number

Returns

INumberFieldExpression

public ValueAsText(): ITextFieldExpression

Specifies that lookup value will be used and this value is of type Text

Returns

ITextFieldExpression

ILookupMultiFieldExpression: ILookupMultiFieldExpression

public EqualTo(value: string): IExpression

Checks whether the value of the field is equal to the specified value

Parameters

  • value: string

Returns

IExpression

public Includes(value: any): IExpression

Checks whether the values of the field includes the specified value

Parameters

  • value: any

Returns

IExpression

public NotEqualTo(value: string): IExpression

Checks whether the value of the field is not equal to the specified value

Parameters

  • value: string

Returns

IExpression

public NotIncludes(value: any): IExpression

Checks whether the values of the field not includes the specified value

Parameters

  • value: any

Returns

IExpression

IMembership: IMembership

DEPRECATED!! Please use UserField(...).IsIn* methods instead. This interface will be removed in the next release

public SPWeb: IMembershipSPWeb

DEPRECATED. Please use UserField(...).IsInSPWeb* methods instead

public CurrentUserGroups(): IExpression

DEPRECATED. Please use UserField(...).IsInCurrentUserGroups() instead

Returns

IExpression

public SPGroup(groupId: number): IExpression

DEPRECATED. Please use UserField(...).IsInSPGroup() instead

Parameters

  • groupId: number

Returns

IExpression

IMembershipSPWeb: IMembershipSPWeb

DEPRECATED!! Please use UserField(...).IsInSPWeb* methods instead. This interface will be removed in the next release

public AllUsers(): IExpression

DEPRECATED. Please use UserField(...).IsInSPWebAllUsers() instead

Returns

IExpression

public Groups(): IExpression

DEPRECATED. Please use UserField(...).IsInSPWebGroups() instead

Returns

IExpression

public Users(): IExpression

DEPRECATED. Please use UserField(...).IsInSPWebUsers() instead

Returns

IExpression

INumberFieldExpression: INumberFieldExpression

public EqualTo(value: number): IExpression

Checks whether the value of the field is equal to the specified value

Parameters

  • value: number

Returns

IExpression

public GreaterThan(value: number): IExpression

Checks whether the value of the field is greater than the specified value

Parameters

  • value: number

Returns

IExpression

public GreaterThanOrEqualTo(value: number): IExpression

Checks whether the value of the field is greater than or equal to the specified value

Parameters

  • value: number

Returns

IExpression

public In(arrayOfValues: Array<number>): IExpression

Checks whether the value of the field is equal to one of the specified values

Parameters

  • arrayOfValues: Array<number>

Returns

IExpression

public IsNotNull(): IExpression

Checks whether the value of the field was not specified by user

Returns

IExpression

public IsNull(): IExpression

Checks whether the value of the field was specified by user

Returns

IExpression

public LessThan(value: number): IExpression

Checks whether the value of the field is less than the specified value

Parameters

  • value: number

Returns

IExpression

public LessThanOrEqualTo(value: number): IExpression

Checks whether the value of the field is less than or equal to the specified value

Parameters

  • value: number

Returns

IExpression

public NotEqualTo(value: number): IExpression

Checks whether the value of the field is not equal to the specified value

Parameters

  • value: number

Returns

IExpression

IQuery: IQuery

public Where(): IFieldExpression

Returns

IFieldExpression

ISortable: ISortable

public OrderBy(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (ascending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public OrderByDesc(fieldInternalName: string, override?: boolean, useIndexForOrderBy?: boolean): ISortedQuery

Adds OrderBy clause to the query (using descending order for the first field).

Parameters

  • fieldInternalName: string

    Internal field of the first field by that the data will be sorted (descending)

  • override?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

  • useIndexForOrderBy?: boolean optional

    This is only necessary for large lists. DON'T use it unless you know what it is for!

Returns

ISortedQuery

public ToString(): string

Get the resulting CAML query as string

Returns

string

ISortedQuery: ISortedQuery

public ThenBy(fieldInternalName: string): any

Specifies next order field (ascending)

Parameters

  • fieldInternalName: string

Returns

any

public ThenByDesc(fieldInternalName: string): any

Specifies next order field (descending)

Parameters

  • fieldInternalName: string

Returns

any

public ToString(): string

Get the resulting CAML query as string

Returns

string

ITextFieldExpression: ITextFieldExpression

public BeginsWith(value: string): IExpression

Checks whether the value of the field begins with the specified substring

Parameters

  • value: string

Returns

IExpression

public Contains(value: string): IExpression

Checks whether the value of the field contains the specified substring

Parameters

  • value: string

Returns

IExpression

public EqualTo(value: string): IExpression

Checks whether the value of the field is equal to the specified value

Parameters

  • value: string

Returns

IExpression

public In(arrayOfValues: Array<string>): IExpression

Checks whether the value of the field is equal to one of the specified values

Parameters

  • arrayOfValues: Array<string>

Returns

IExpression

public IsNotNull(): IExpression

Checks whether the value of the field was not specified by user

Returns

IExpression

public IsNull(): IExpression

Checks whether the value of the field was specified by user

Returns

IExpression

public NotEqualTo(value: string): IExpression

Checks whether the value of the field is not equal to the specified value

Parameters

  • value: string

Returns

IExpression

IUserFieldExpression: IUserFieldExpression

public Membership: IMembership

DEPRECATED. Please use IsIn* methods instead. This property will be removed in next release(!!)

public EqualToCurrentUser(): IExpression

Checks whether the value of the User field is equal to id of the current user

Returns

IExpression

public Id(): INumberFieldExpression

Specifies that id of the user will be used for further comparisons.

Returns

INumberFieldExpression

public IsInCurrentUserGroups(): IExpression

Checks whether the group specified by the value of the field includes the current user.

Returns

IExpression

public IsInSPGroup(groupId: number): IExpression

Checks whether the user specified by the value of the field is member of the specified SharePoint Group.

Parameters

  • groupId: number

Returns

IExpression

public IsInSPWebAllUsers(): IExpression

Checks whether the user specified by the value of the field is in current SPWeb users.

Returns

IExpression

public IsInSPWebGroups(): IExpression

Checks whether the user specified by the value of the field is member of current SPWeb groups.

Returns

IExpression

public IsInSPWebUsers(): IExpression

Checks whether the user specified by the value of the field has received the rights to the site directly (not through a group).

Returns

IExpression

public ValueAsText(): ITextFieldExpression

Specifies that lookup target field value will be used for further comparisons.

Returns

ITextFieldExpression

IView: IView

public Query(): IQuery

Returns

IQuery

Classes

CamlValues: CamlValues

public static ListProperty: { Created: string; DefaultViewUrl: string; Description: string; EnableSyndication: string; ItemCount: string; LinkTitle: string; MajorVersionLimit: string; MajorWithMinorVersionsLimit: string; RelativeFolderPath: string; Title: string; ViewSelector: string; }

Dynamic value that represents a property of the current list

public ListProperty.Created: string

public ListProperty.DefaultViewUrl: string

public ListProperty.Description: string

public ListProperty.EnableSyndication: string

public ListProperty.ItemCount: string

public ListProperty.LinkTitle: string

public ListProperty.MajorVersionLimit: string

public ListProperty.MajorWithMinorVersionsLimit: string

public ListProperty.RelativeFolderPath: string

public ListProperty.Title: string

public ListProperty.ViewSelector: string

public static Now: string

public static ProjectProperty: { BlogCategoryTitle: string; BlogPostTitle: string; Description: string; RecycleBinEnabled: string; SiteOwnerName: string; SiteUrl: string; Title: string; Url: string; }

Dynamic value that represents a property of the current SPWeb

public ProjectProperty.BlogCategoryTitle: string

public ProjectProperty.BlogPostTitle: string

public ProjectProperty.Description: string

public ProjectProperty.RecycleBinEnabled: string

public ProjectProperty.SiteOwnerName: string

public ProjectProperty.SiteUrl: string

public ProjectProperty.Title: string

public ProjectProperty.Url: string

public static Today: string

Dynamic value that represents current date

public static UserID: string

Dynamic value that represents Id of the current user

public static TodayWithOffset(offsetDays: number): string

Dynamic value that represents current date with specified offset (may be negative)

Parameters

  • offsetDays: number

Returns

string

Internal: Internal

public static createExpression(): IFieldExpression

Returns

IFieldExpression

public static createView(): IView

Returns

IView

public static createWhere(): IFieldExpression

Returns

IFieldExpression

Constructor methods

constructor(): CamlBuilder

Returns

CamlBuilder

Methods

public static Expression(): IFieldExpression

Use for:

  1. SPServices CAMLQuery attribute
  2. Creating partial expressions
  3. In conjunction with Any & All clauses

Returns

IFieldExpression

public Where(): IFieldExpression

Returns

IFieldExpression