Cli-microsoft365: Update 'spo list view set' command capabilities

Created on 28 Dec 2018  路  16Comments  路  Source: pnp/cli-microsoft365

Summary

Current behavior

Currently, with the spo list view set command, you can :

  • [x] Update title of the specific SharePoint view
  • [x] Update SharePoint view formatting (json)

Additional behavior

  • [ ] Update existing list column position to an existing list view

    • [ ] --fieldId / --fieldTitle (ID or Title not both)

    • [ ] --viewId / --viewTitle (ID or Title not both)

    • [ ] -u, --webUrl Web URL

    • [ ] --fieldPosition value : [integer only] (if value is out of bound, the position will be the last available)

Combined to spo list view list that will be possible to update all views of specific list

Note : I didn't understand the usage of --updateExistingLists parameter 馃槚 If anyone can tell me a little more...

To Do

  • [ ] Add command from solution
  • [ ] Add documentation of usage (MkDocs)
  • [ ] Validate cmdlet usage
  • [ ] Validate Unit test
enhancement feature request help wanted

All 16 comments

For simplicity, I'd suggest we split this spec into multiple commands, eg. spo list view field add to add a column to an existing view, spo list view field remove to remove it. As for changing the order, perhaps extending spo list view set would make the most sense.

Ok, that's make sense.
I'll split this issue !

Are you agree with the fieldPosition parameter ?

Just to check if I understand your proposal correctly. To change the order of a field in the view you would call:

o365 spo list view set --webUrl https://contoso.sharepoint.com --listTitle MyList --viewTitle MyView --fieldTitle MyField --fieldPosition 3

It would work, if you wanted to change the order of one field. It could quickly get complicated though, if you wanted to change the order of multiple fields. Let's start with this implementation and we can extend it in the future if need be to allow reordering all fields.

Yes, we can extend the order management for several columns through JSON for example

Let's ship the above first and then add support for several columns as a separate enhancement.

@waldekmastykarz
Since we're adding the cmdlet spo list view field add, do you want to conserve the spo list view field set with the same parameters ? Because the target is the same, that made a doublon, isn't it ?

Sorry, I don't understand what you mean @Laul0 馃槉

We had planned to add the capability of list view set cmdlet to add a column.
We had planned to add cmdlet list view field add that allow to add a column to a view.
The purpose is the same, isn't it ?

Understood. Looking at both commands we should have:

  • list view field add - to add a column to an existing view
  • list view field set - to update a column in an existing view (eg. move to a specific position)
  • list view set - update view properties (title, description, etc.)

Hey @Laul0 are you still working on this?

I have to finish my spec for spo list view field add and I'll work on it

Hey @Laul0, did you have a chance to pick this up or should we let others chime in?

Hi @waldekmastykarz, I'm finishing the mail send cmdlet first and I'll work on it.
Sorry for the delay, it is a period of holiday and family.

However, if someone else want to work on it, to be quicker, he is welcome

No problem! I'll reset this command as available for picking and you can always take it back when you have time.

Create a new spec for the last remaining issue #2059.
Commands that are already updated in the CLI are:

  • spo list view field add
  • list view set
Was this page helpful?
0 / 5 - 0 ratings