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,listIdorlistUrl, but not multiple.-t, --listTitle [listTitle]Title of the list. Specify either
listTitle,listIdorlistUrl, but not multiple.--listUrl [listUrl]Server- or site-relative URL of the list. Specify either
listTitle,listIdorlistUrl, but not multiple.-p, --filePath [filePath]The absolute or relative path to a flat CSV file containing the list items. Specify
filePathorids, but not both.-i, --ids [ids]Comma separated list of list item IDs. Specify
filePathorids, but not both.-r, --recycleRecycle the list items. Otherwise, they will be permanently deleted.
-f, --forceDon'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,permissions,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.--verboseRuns command with verbose logging.
--debugRuns 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.