Skip to content

New command: update properties of the specified list #205

@waldekmastykarz

Description

@waldekmastykarz

Update properties of the specified list

  • command: spo list set -i|-id [id] -t|--title [title] -u|--webUrl <webUrl> (additional properties)
  • title: List title
  • id: List ID
  • webUrl: Absolute URL of the site where the list is located
  • specify either title or id but not both to retrieve the list

List of additional properties that can be set:

AllowDeletion
AllowEveryoneViewItems
AllowMultiResponses
ContentTypesEnabled
CrawlNonDefaultViews
DefaultContentApprovalWorkflowId
DefaultDisplayFormUrl
DefaultEditFormUrl
Description
Direction
DisableGridEditing
DraftVersionVisibility
EmailAlias
EnableAssignToEmail
EnableAttachments
EnableDeployWithDependentList
EnableFolderCreation
EnableMinorVersions
EnableModeration
EnablePeopleSelector
EnableResourceSelector
EnableSchemaCaching
EnableSyndication
EnableThrottling
EnableVersioning
EnforceDataValidation
ExcludeFromOfflineClient
FetchPropertyBagForListView
Followable
ForceCheckout
ForceDefaultContentType
Hidden
IncludedInMyFilesScope
IndexedRootFolderPropertyKeys
IrmEnabled
IrmExpire
IrmReject
IsApplicationList
ListExperienceOptions
MajorVersionLimit
MajorWithMinorVersionsLimit
MultipleDataList
NavigateForFormsPages
NeedUpdateSiteClientTag
NoCrawl
OnQuickLaunch
Ordered
ParserDisabled
ReadOnlyUI
ReadSecurity
RequestAccessEnabled
RestrictUserUpdates
SendToLocationName
SendToLocationUrl
ShowUser
SmsAlertTemplate
UseFormsForDisplay
ValidationFormula
ValidationMessage
WriteSecurity

For each property create a command option with corresponding basic type validation (eg. boolean, number, etc.). Take description of each property from https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist_properties.aspx.

Update list using:

POST <webUrl>/_api/web/list(guid'[id]')
or
POST <webUrl>/_api/web/list/GetByTitle('[title]')

accept: application/json;odata=nometadata
content-type: application/json;odata=nometadata
X-HTTP-Method: MERGE
x-requestdigest: 0x5AB7E...

{
  ...properties set on command
}

Ensure you have access token for the web specified in the webUrl option.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions