Skip to content

Update command: spo list view add #1862

@sebastienlevert

Description

@sebastienlevert

Usage

spo list view add [options]

Description

Adds a new view to a SharePoint list with a set of fields and providing the viewQuery.

Options

Would leverage the existing set of options and add :

Option Description
--viewQuery Xml representation of the list query for the underlying view

Additional Information

A simple POST to an existing view could be done using the following pseudo-code :

POST "/_api/web/lists/getByTitle('List Name')/views/getByTitle('ListViewName')"

Content-Type: application/json

{
  '__metadata': {
    'type': 'SP.View'
  },
 'ViewQuery': '<OrderBy><FieldRef Name=\"ID\" /></OrderBy><Where><Eq><FieldRef Name=\"ColumnName\" /><Value Type=\"Text\">ValueofColumn</Value></Eq></Where>'
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions