Skip to content

Extends 'spo listitem get' command. Closes #2382#2464

Closed
nanddeepn wants to merge 2 commits intopnp:mainfrom
nanddeepn:extend-spo-listitem-get
Closed

Extends 'spo listitem get' command. Closes #2382#2464
nanddeepn wants to merge 2 commits intopnp:mainfrom
nanddeepn:extend-spo-listitem-get

Conversation

@nanddeepn
Copy link
Copy Markdown
Contributor

Extends 'spo listitem get' command. Closes #2382

Extends 'spo listitem get' command to retrieve properties using option --properties

@waldekmastykarz
Copy link
Copy Markdown
Member

Awesome! We'll review it in the coming days as we're preparing for a release. Thank you!

@waldekmastykarz waldekmastykarz self-assigned this Jun 6, 2021
Copy link
Copy Markdown
Member

@waldekmastykarz waldekmastykarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command fails with an error when you use the JSON output mode:

$ m365 spo listitem get -u / --listTitle MyList --id 5 --properties FileRef,ID -o json
Error: The expression "web/lists/getByTitle('MyList')/items(5),FileRef,ID" is not valid.

Could you please double check your changes?

@waldekmastykarz waldekmastykarz removed their assignment Jun 6, 2021
@waldekmastykarz waldekmastykarz marked this pull request as draft June 6, 2021 18:06
@nanddeepn nanddeepn marked this pull request as ready for review June 7, 2021 11:34
@waldekmastykarz
Copy link
Copy Markdown
Member

Sorry I didn't catch it earlier, but what's exactly the difference between using field and properties? It seems they both end up in the $select query so why should we introduce another option?

@nanddeepn
Copy link
Copy Markdown
Contributor Author

Hi @waldekmastykarz
You are right. Both field and properties will end up in $select query.
However from the caller's point of view, they are different parameters.

@waldekmastykarz
Copy link
Copy Markdown
Member

You're right. Would renaming fields to properties be sufficient or would it still be confusing to end-users? Is there perhaps another word that's would clarify both use cases?

@pnp/cli-for-microsoft-365-maintainers what do you think?

@garrytrinder
Copy link
Copy Markdown
Member

Sorry I didn't catch it earlier, but what's exactly the difference between using field and properties? It seems they both end up in the $select query so why should we introduce another option?

I don't see the value in making the change, introducing another option would just cause confusion. Renaming the field option to something more suitable would be a breaking change, if we were to do this I would prefer the term properties over fields.

@waldekmastykarz
Copy link
Copy Markdown
Member

Would renaming fields to properties be worth considering for v4 or is cosmetics?

@garrytrinder
Copy link
Copy Markdown
Member

I think properties is the more appropriate terminology.

@arjunumenon
Copy link
Copy Markdown
Member

I am also in an opinion to rename it to properties rather than fields. It makes more consistent with the generic SharePoint terminologies and I am in opinion that the end users would be able to connect it well with properties

@waldekmastykarz
Copy link
Copy Markdown
Member

In that case, I'd suggest that we close this PR and the related issue and open a new issue scheduled for the v4 version of CLI that will introduce the breaking change of renaming fields to properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Extend 'spo listitem get' command to retrieve properties using option --properties

4 participants