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: Get the fields of a Content Type #5677

Open
martinlingstuyl opened this issue Nov 16, 2023 · 8 comments · May be fixed by #5974
Open

New Command: Get the fields of a Content Type #5677

martinlingstuyl opened this issue Nov 16, 2023 · 8 comments · May be fixed by #5974

Comments

@martinlingstuyl
Copy link
Contributor

martinlingstuyl commented Nov 16, 2023

One specific scenario that are are currently missing...

Usage

m365 spo contenttype field list

Description

Lists fields for a given site or list content type

Options

Option Description
-u, --webUrl <webUrl> URL of the SharePoint site.
-i, --contentTypeId [contentTypeId] The ID of the Content Type to list fields for. Specify either contentTypeId or contentTypeName.
-n, --contentTypeName [contentTypeName] The name of the Content Type to list fields for. Specify either contentTypeId or contentTypeName.
-t, --listTitle [listTitle] Optional title of the list where the content type is located. Specify either listTitle, listId or listUrl.
--listId [listId] Optional ID of the list where the fields are located. Specify either listTitle, listId or listUrl.
--listUrl [listUrl] Optional Server- or web-relative URL of the list where the fields are located. Specify either listTitle, listId or listUrl.
-p, --properties [properties] Comma-separated list of properties to retrieve. Will retrieve all properties if not specified.

Examples

Retrieves columns for the specified site content type

m365 spo contenttype field list --webUrl https://contoso.sharepoint.com/sites/contoso-sales --contentTypeId "0x01"

Retrieves columns for the specified list content type in the Documents library

m365 spo contenttype field list --webUrl https://contoso.sharepoint.com/sites/contoso-sales --contentTypeName "Document" --listTitle "Documents"

Additional Info

@martinlingstuyl martinlingstuyl added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Nov 16, 2023
@martinlingstuyl
Copy link
Contributor Author

@waldekmastykarz: when I'm reading my own specs I'm thinking: we should have --properties for all list commands as well...

@waldekmastykarz
Copy link
Member

@waldekmastykarz: when I'm reading my own specs I'm thinking: we should have --properties for all list commands as well...

I was just about to ask the same 😉 Seems very much like the $select OData query param. I suggest we take it separately.

Also, shouldn't we support referring to the content type by its name?

@martinlingstuyl
Copy link
Contributor Author

Updated!

@waldekmastykarz waldekmastykarz added help wanted good first issue and removed needs peer review Needs second pair of eyes to review the spec or PR labels Nov 17, 2023
@Adam-it
Copy link
Contributor

Adam-it commented Nov 18, 2023

Awesome suggestion 👏. Let's get this 🚢

@nicodecleyre
Copy link
Contributor

Is it intentionally that you removed --properties in your last edit @martinlingstuyl?

@martinlingstuyl
Copy link
Contributor Author

Yes it was, as we were discussing a possible cli wide implementation of --properties. However; we've put that in the freezer, so we could add properties again here. Seems a logical place to add it

@MathijsVerbeeck
Copy link
Contributor

Can I work on this?

@Adam-it
Copy link
Contributor

Adam-it commented Apr 10, 2024

Can I work on this?

All yours

@MathijsVerbeeck MathijsVerbeeck linked a pull request Apr 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants