Version

options Object Structure

Property

Type

Description

listName

String

GUID of the SharePoint list (not the display name).

webUrl

String

URL to the SharePoint site containing the list.

viewName

String

Name of the SharePoint List view.

fields

Array

Array of field values to be retrieved for each item

where

String

Where condition used in the query.

orderBy

String

OrderBy condition used in the query.

queryOptions

XML node

XML node with several properties used in the query.

Notes

  1. To search inside subfolders, you need to set the scope property from queryOptions to "Recursive All".

    Sample snippet:

    '<QueryOptions>' +
    '<IncludeAttachmentUrls>TRUE</IncludeAttachmentUrls>' +
    '<ViewAttributes Scope="RecursiveAll" />' +
    '</QueryOptions>';
  2. When a where clause is present, the viewName value is ignored by List.getItemsWithOptions and only the CAML query is used to filter content.