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

Adds command 'spo defaultcolumnvalue list' #6442

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const dictionary = [
'catalog',
'checklist',
'client',
'column',
'comm',
'command',
'community',
Expand Down Expand Up @@ -116,6 +117,7 @@ const dictionary = [
'unit',
'url',
'user',
'value',
'web',
'webhook'
];
Expand Down
110 changes: 110 additions & 0 deletions docs/docs/cmd/spo/list/list-defaultcolumnvalue-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo list defaultcolumnvalue list

Retrieves default column values set for a specific document library

## Usage

```sh
m365 spo list defaultcolumnvalue list [options]
```

## Options

```md definition-list
`-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`.

`--folderUrl [folderUrl]`
: Only get default column values from a specific folder.
```

<Global />

## Examples

List all default column values of a list specified by title

```sh
m365 spo list defaultcolumnvalue list --webUrl https://contoso.sharepoint.com/sites/marketing --listTitle "Project Documents"
```

List all default column values of a list specified by ID

```sh
m365 spo list defaultcolumnvalue list --webUrl https://contoso.sharepoint.com/sites/marketing --listId 12345678-90ab-cdef-1234-567890abcdef
```

List all default column values of a list specified by server relative URL

```sh
m365 spo list defaultcolumnvalue list --webUrl https://contoso.sharepoint.com/sites/marketing --listUrl "/sites/marketing/Project Documents"
```

List all default column values of a specific folder in a list specified by site relative URLs

```sh
m365 spo list defaultcolumnvalue list --webUrl https://contoso.sharepoint.com/sites/marketing --listUrl "/Project Documents" --folderUrl "/Project Documents/Archive"
```

## Response

<Tabs>
<TabItem value="JSON">

```json
[
{
"Field": "Countries",
"Value": "19;#Belgium|442affc2-7fab-4f33-9590-330403a579c2",
"Path": "/sites/Marketing/Project Documents"
}
]
```

</TabItem>
<TabItem value="Text">

```text
Field Value Path
--------- ------------------------------------------------ ----------------------------------
Countries 19;#Belgium|442affc2-7fab-4f33-9590-330403a579c2 /sites/Marketing/Project Documents
```

</TabItem>
<TabItem value="CSV">

```csv
Field,Value,Path
Countries,19;#Belgium|442affc2-7fab-4f33-9590-330403a579c2,/sites/Marketing/Project Documents
```

</TabItem>
<TabItem value="Markdown">

```md
# spo list defaultcolumnvalue list --webUrl "https://contoso.sharepoint.com/sites/marketing" --listUrl "/Project Documents"

Date: 20/10/2024

Property | Value
---------|-------
Field | Countries
Value | 19;#Belgium\|442affc2-7fab-4f33-9590-330403a579c2
Path | /sites/Marketing/Project Documents
```

</TabItem>
</Tabs>
5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,11 @@ const sidebars: SidebarsConfig = {
label: 'list contenttype default set',
id: 'cmd/spo/list/list-contenttype-default-set'
},
{
type: 'doc',
label: 'list defaultcolumnvalue list',
id: 'cmd/spo/list/list-defaultcolumnvalue-list'
},
{
type: 'doc',
label: 'list retentionlabel ensure',
Expand Down
1 change: 1 addition & 0 deletions src/m365/spo/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default {
LIST_CONTENTTYPE_LIST: `${prefix} list contenttype list`,
LIST_CONTENTTYPE_REMOVE: `${prefix} list contenttype remove`,
LIST_CONTENTTYPE_DEFAULT_SET: `${prefix} list contenttype default set`,
LIST_DEFAULTCOLUMNVALUE_LIST: `${prefix} list defaultcolumnvalue list`,
LIST_GET: `${prefix} list get`,
LIST_LIST: `${prefix} list list`,
LIST_REMOVE: `${prefix} list remove`,
Expand Down
Loading