spo listitem batch remove
Removes items from a list in batch
Usage
m365 spo listitem batch remove [options]
Options
-u, --webUrl <webUrl>
URL of the SharePoint site.
-l, --listId [listId]
ID of the list. Specify either
listTitle
,listId
orlistUrl
, but not multiple.-t, --listTitle [listTitle]
Title of the list. Specify either
listTitle
,listId
orlistUrl
, but not multiple.--listUrl [listUrl]
Server- or site-relative URL of the list. Specify either
listTitle
,listId
orlistUrl
, but not multiple.-p, --filePath [filePath]
The absolute or relative path to a flat CSV file containing the list items. Specify
filePath
orids
, but not both.-i, --ids [ids]
Comma separated list of list item IDs. Specify
filePath
orids
, but not both.-r, --recycle
Recycle the list items. Otherwise, they will be permanently deleted.
-f, --force
Don't prompt for confirmation.
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,response
,full
. Default isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
A sample CSV can be found below. The first line of the CSV-file should contain the internal column name of the ID-column.
ID
123
234
345
Examples
Remove a list of IDs from a list with a csv
m365 spo listitem batch remove --filePath ./IDlist.csv --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "Demo List"
Remove a list of IDs from a list by specifying the IDs
m365 spo listitem batch remove --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "Demo List" --ids "123,234,345"
Response
The command won't return a response on success.