Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: spo list defaultcolumnvalue set #6503

Open
milanholemans opened this issue Nov 25, 2024 · 3 comments
Open

New command: spo list defaultcolumnvalue set #6503

milanholemans opened this issue Nov 25, 2024 · 3 comments
Assignees
Labels
needs peer review Needs second pair of eyes to review the spec or PR new feature

Comments

@milanholemans
Copy link
Contributor

Usage

m365 spo list defaultcolumnvalue 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.
--field <field> Internal name of the field.
--value <value> 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 defaultcolumnvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --field Company --value Contoso

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

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

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

m365 spo list defaultcolumnvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --folderUrl "/sites/Marketing/Logos/Contoso" --field Countries --value "-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 defaultcolumnvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --field Published --value "[today]"

Set a default folder value for a date field

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

Set a default folder value for a choice field

m365 spo list defaultcolumnvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --field FileType --value "Logo"

Set a default folder value for a multi-choice field

m365 spo list defaultcolumnvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --field FileTypes --value "Logo;#Brand"

Set a default folder value for a yes/no field

m365 spo list defaultcolumnvalue set --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle Logos --field Active --value 1

Set a default folder value for a user field

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

Set a default folder value for a multi-user field

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

Default properties

No response

Additional Info

Warning

Folders with special characters are not supported.

@milanholemans milanholemans added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Nov 25, 2024
@milanholemans milanholemans self-assigned this Nov 25, 2024
@Adam-it
Copy link
Member

Adam-it commented Nov 27, 2024

@milanholemans isn't it possible to set default value for a column on a list using
m365 spo field set --webUrl "https://tenanttocheck.sharepoint.com/sites/PnPDemo2" --listTitle "aaa" --title "aaa" --DefaultValue "bbb"

@milanholemans
Copy link
Contributor Author

It's not about setting a default field value, but about setting a folder default value on a list. In the UI, you can do it over here:

image

It's related to #6404

@Adam-it
Copy link
Member

Adam-it commented Nov 28, 2024

aaaa ok now I get it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs peer review Needs second pair of eyes to review the spec or PR new feature
Projects
None yet
Development

No branches or pull requests

2 participants