Skip to main content

spo list defaultvalue set

Sets default column values for a specific document library

Usage

m365 spo list defaultvalue set [options]

Options

-u, --webUrl <webUrl>

URL of the site where the list is located.

-i, --listId [listId]

ID of the list. Specify either listTitle, listId, or listUrl.

-t, --listTitle [listTitle]

Title of the list. Specify either listTitle, listId, or listUrl.

--listUrl [listUrl]

Server- or site-relative URL of the list. Specify either listTitle, listId, or listUrl.

--fieldName <fieldName>

Internal name of the field.

--fieldValue <fieldValue>

Default value of the field.

--folderUrl [folderUrl]

Set the value for a specific folder by specifying a server- or site-relative URL. By default, the root folder of the list is used.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

note

Due to limitations in SharePoint Online, setting default column values for folders with a # or % character in their path is not supported.

Examples

Set a default folder value on the root folder of a list for a text field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName Company --fieldValue Contoso

Set a default folder value for a taxonomy field on a specific folder

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --folderUrl "/sites/Marketing/Logos/Contoso" --fieldName Country --fieldValue "-1;#Belgium|442affc2-7fab-4f33-9590-330403a579c2"

Set a default folder value for a multi-taxonomy field on a specific folder

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listUrl /sites/marketing/Logos --folderUrl "/sites/Marketing/Logos/Contoso" --fieldName Countries --fieldValue "-1;#Belgium|442affc2-7fab-4f33-9590-330403a579c2;#-1;#France|14888324-5c48-46db-b748-215cbe24eb4c"

Set a default folder value for a date field to today

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listId 3540460d-cb6e-4bc5-8380-bc1844401ee3 --fieldName Published --fieldValue "[today]"

Set a default folder value for a date field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName Published --fieldValue "2020-05-03T11:00:00Z"

Set a default folder value for a choice field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listUrl /sites/marketing/Logos --fieldName FileType --fieldValue Logo

Set a default folder value for a multi-choice field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName FileTypes --fieldValue "Logo;#Brand"

Set a default folder value for a yes/no field using site-relative list URL

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listUrl /Logos --fieldName Active --fieldValue 1

Set a default folder value for a user field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listId 3540460d-cb6e-4bc5-8380-bc1844401ee3 --fieldName Responsible --fieldValue "1;#john.doe@contoso.com"

Set a default folder value for a multi-user field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listId 3540460d-cb6e-4bc5-8380-bc1844401ee3 --fieldName Responsible --fieldValue "1;#john.doe@contoso.com;#2;#adele.vance@contoso.com"

Response

The command won't return a response on success.

CTRL + M