Skip to content

New command: spo list defaultvalue set #6503

@milanholemans

Description

@milanholemans

Usage

m365 spo list defaultvalue set [options]

Description

Sets default column values for a specific document library

Options

Option Description
-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> Value of the field.
--folderUrl [folderUrl] Set the value on a specific folder. By default, the root folder of the list is used.

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 --fieldValueContoso

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 --listTitle 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 --listTitle Logos --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 --listTitle 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

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName Active --fieldValue1

Set a default folder value for a user field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName Responsible --fieldValue"1;#[email protected]"

Set a default folder value for a multi-user field

m365 spo list defaultvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --fieldName Responsible --fieldValue"1;#[email protected];#2;#[email protected]"

Default properties

No response

Additional Info

Warning

Folders with special characters are not supported.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions