View on GitHub

SharePoint REST Framework

An easy way to develop against the SharePoint 2013/Online REST API

Back

List

Code Reference

// JavaScript
var $REST = require("gd-sprest");
$REST.List()

// TypeScript
import { List } from "gd-sprest";
new List()

Code Examples

Properties

Property Type Description
AllowContentTypes boolean Gets a value that specifies whether the list supports content types.
AllowDeletion boolean  
BaseTemplate ListTemplateType Gets the list definition type on which the list is based. Represents a ListTemplateType value. See ListTemplateType in the .NET client object model reference for template type values.
BaseType number Gets the base type for the list. (Generic List - 0, Document Library - 1, Discussion Board - 3, Survey - 4, Issue - 5)
BrowserFileHandling number Gets a value that specifies the override of the web application’s BrowserFileHandling property at the list level. (Permissive - 0, Strict - 1)
ContentTypesEnabled boolean Gets or sets a value that specifies whether content types are enabled for the list.
Created string Gets a value that specifies when the list was created.
CurrentChangeToken Types.IStringValue  
DefaultContentApprovalWorkflowId string Gets a value that specifies the default workflow identifier for content approval on the list. Returns an empty GUID if there is no default content approval workflow.
Description string Gets or sets a value that specifies the description of the list.
Direction string Gets or sets a value that specifies the reading order of the list. (Return Values - ‘None’, ‘LTR’, ‘RTL’)
DocumentTemplateUrl string Gets or sets a value that specifies the server-relative URL of the document template for the list. Returns a server-relative URL if the base type is DocumentLibrary, otherwise returns null.
DraftVersionVisibility number Gets or sets a value that specifies the minimum permission required to view minor versions and drafts within the list. (Reader - 0, Author - 1, Approver - 2)
EnableAssignToEmail boolean  
EnableAttachments boolean Gets or sets a value that specifies whether list item attachments are enabled for the list.
EnableFolderCreation boolean Gets or sets a value that specifies whether new list folders can be added to the list.
EnableMinorVersions boolean Gets or sets a value that specifies whether minor versions are enabled for the list.
EnableModeration boolean Gets or sets a value that specifies whether content approval is enabled for the list.
EnableVersioning boolean Gets or sets a value that specifies whether historical versions of list items and documents can be created in the list.
EntityTypeName string  
ExcludeFromOfflineClient boolean  
FileSavePostProcessingEnabled boolean  
ForceCheckout boolean Gets or sets a value that indicates whether forced checkout is enabled for the document library.
HasExternalDataSource boolean Gets a value that specifies whether the list is an external list.
Hidden boolean Gets or sets a Boolean value that specifies whether the list is hidden. If true, the server sets the OnQuickLaunch property to false.
Id string Gets the GUID that identifies the list in the database.
ImageUrl string Gets a value that specifies the URI for the icon of the list.
IrmEnabled boolean  
IrmExpire boolean  
IrmReject boolean  
IsApplicationList boolean Gets or sets a value that specifies a flag that a client application can use to determine whether to display the list.
IsCatalog boolean Gets a value that specifies whether the list is a gallery.
IsPrivate boolean  
ItemCount number Gets a value that specifies the number of list items in the list.
LastItemDeletedDate string Gets a value that specifies the last time a list item was deleted from the list.
LastItemModifiedDate string Gets a value that specifies the last time a list item, field, or property of the list was modified.
ListExperienceOptions number  
ListItemEntityTypeFullName string  
MajorVersionLimit number  
MajorWithMinorVersionsLimit number  
MultipleDataList boolean Gets or sets a value that indicates whether the list in a Meeting Workspace site contains data for multiple meeting instances within the site.
NoCrawl boolean Gets or sets a value that specifies that the crawler must not crawl the list.
ParentWebUrl string Gets a value that specifies the server-relative URL of the site that contains the list.
ParserDisabled boolean  
ReadSecurity number  
ServerTemplateCanCreateFolders boolean Gets a value that indicates whether folders can be created within the list.
TemplateFeatureId string Gets a value that specifies the feature identifier of the feature that contains the list schema for the list. Returns an empty GUID if the list schema is not contained within a feature.
Title string Gets or sets the displayed title for the list. (Length must be <= 255 characters)

Queryable Properties

Method Type Description
ContentTypes() ContentTypes Gets the content types that are associated with the list.
ContentTypes(id: string) ContentType Gets the content types that are associated with the list.
DataSource() Array<string> Gets the data source associated with the list, or null if the list is not a virtual list. Returns null if the HasExternalDataSource property is false.
DefaultDisplayFormUrl() string Gets a value that specifies the location of the default display form for the list. Clients specify a server-relative URL, and the server returns a site-relative URL.
DefaultEditFormUrl() string Gets a value that specifies the URL of the edit form to use for list items in the list. Clients specify a server-relative URL, and the server returns a site-relative URL.
DefaultNewFormUrl() string Gets a value that specifies the location of the default new form for the list. Clients specify a server-relative URL, and the server returns a site-relative URL.
DefaultView() View Gets the default list view.
DefaultViewUrl() string Gets the URL of the default view for the list.
DescriptionResouce() ResourcePath  
EffectiveBasePermissions() BasePermissions Gets a value that specifies the effective permissions on the list that are assigned to the current user.
EffectiveBasePermissionsForUI() BasePermissions Gets a value that specifies the effective permissions on the list that are for the user export interface.
EventReceivers() EventReceivers Gets the event receivers associated with the list.
EventReceivers(id: string) EventReceiver_ Gets the event receiver associated with the list.
Fields() Fields Gets the fields in the list.
Fields(internalNameOrTitle: string) Field_ Gets the field in the list.
FirstUniqueAncestorSecurableObject() string Gets the object where role assignments for this object are defined. If role assignments are defined directly on the current object, the current object is returned.
Forms()   Gets the list forms in the list.
Forms(id: string)   Gets the list form in the list.
HasUniqueRoleAssignments()   Gets a value that specifies whether the role assignments are uniquely defined for this securable object or inherited from a parent securable object.
InformationRightsManagementSettings()   Gets a value that specifies the information rights management settings.
IsSiteAssetsLibrary() boolean Gets a value that indicates whether the list is designated as a default asset location for images or other files which the users upload to their wiki pages.
Items() ListItems Gets the list items in the list.
Items(id: number) ListItem_ Gets the list item in the list.
OnQuickLaunch() boolean Gets or sets a value that specifies whether the list appears on the Quick Launch of the site. If true, the server sets the Hidden property to false.
ParentWeb() Web Gets a value that specifies the site that contains the list.
RoleAssignments() RoleAssignments Gets the role assignments for the securable object.
RoleAssignments(id | string)_   Gets the role assignments for the securable object.
RootFolder() Folder Gets the root folder of the list.
RootFolder(url: string) File_ Gets the file in the root folder of the list.
SchemaXml() string Gets a value that specifies the list schema of the list.
Subscriptions()    
TitleResource() _ResourcePath  
UserCustomActions() UserCustomActions Gets the user custom actions for the list.
UserCustomActions(id: string) UserCustomAction Gets the user custom action(s) for the list.
ValidationFormula() string Gets or sets a value that specifies the data validation criteria for a list item. (Length must be <= 1023)
ValidationMessage() string Gets or sets a value that specifies the error message returned when data validation fails for a list item. (Length must be <= 1023)
Views() Views Gets the list views.
Views(id: string) View Gets the view in the list.
WorkflowAssociations() string Gets a value that specifies the collection of all workflow associations for the list.
WriteSecurity() number  

Methods

Method Description
breakRoleInheritance(copyRoleAssignments, clearSubScopes) Creates unique role assignments for the securable object.
delete() Deletes the list.
getByEntityName(entityTypeName, callback) A static method to get the list by the entity name.
getChanges(query) Returns the collection of changes from the change log that have occurred within the list, based on the specified query.
getItemById(id) Returns the list item with the specified list item identifier.
getItems(viewXml) Returns a collection of items from the list based on the view xml.
getItemsByQuery(camlQuery) Returns a collection of items from the list based on the specified query.
getListItemChangesSinceToken(query) Returns a collection of items from the list based on the specified query.
getRelatedFields() Returns a collection of lookup fields that use this list as a data source and that have FieldLookup.IsRelationship set to true.
getUserEffectivePermissions(loginName) Gets the effective user permissions for the current user.
getViewById(viewId) Returns the list view with the specified view identifier.
recycle() Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item.
renderListData(viewXml) Renders the list data.
renderListFormData(itemId, formId, controlMode) Renders the list form data. (1 - Display, 2 - Edit, 3 - New, 4 - View)_
reserveListItemId() Reserves a list item ID for idempotent list item creation.
resetRoleInheritance() Resets the role inheritance for the securable object and inherits role assignments from the parent securable object.
update(props) Updates the object properties.

List Creation Information

Name Type Description
BaseTemplate Types.SPTypes.ListTemplateType The list template type.
CustomSchemaXml string The list schema xml.
DataSourceProperties Array<string> The list of data source properties.
Description string The list description.
DocumentTemplateType number The list document template type.
QuickLaunchOption number Option to display the list on the quick launch.
TemplateFeatureId string The list template feature id.
Title string The list name.

List Template

Name Type
AllowsFolderCreation boolean
Description string
FeatureId string
Hidden boolean
ImageUrl string
InternalName string
IsCustomTemplate boolean
ListTemplateTypeKind number
Name string
OnQuickLaunch boolean
Unique boolean

List Template Types

Name Value
AccessRequest 160
AdminTasks 1200
Agenda 201
AppDataCatalog 125
Announcements 104
CallTrack 404
Categories 303
Circulation 405
Comments 302
Contacts 105
CustomGrid 120
DataConnectionLibrary 130
DataSources 110
Decision 204
DesignCatalog 124
DeveloperSiteDraftApps 1230
DiscussionBoard 108
DocumentLibrary 101
Events 106
ExternalList 600
Facility 402
GanttTasks 150
GenericList 100
HealthReports 1221
HealthRules 1220
HelpLibrary 151
Holidays 421
HomePageLibrary 212
IMEDic 499
IssueTracking 1100
Links 103
ListTemplateCatalog 114
MasterPageCatalog 116
MaintenanceLogs 175
MeetingObjective 207
Meetings 200
MeetingUser 202
MySiteDocumentLibrary 700
Posts 301
NoCodePublic 122
NoCodeWorkflows 117
PictureLibrary 109
SolutionCatalog 121
Survey 102
Tasks 107
TasksWithTimelineAndHierarchy 171
TextBox 210
ThemeCatalog 123
ThingsToBring 211
Timecard 420
UserInformation 112
WebPageLibrary 119
WebPartCatalog 113
WebTemplateCatalog 111
Whereabouts 403
WorkflowHistory 140
WorkflowProcess 118
XMLForm 115