delete_sp_list_item() deletes a single SharePoint list item and
delete_sp_list_items() deletes multiple SharePoint list items. Set
confirm = FALSE to use without interactive confirmation.
Usage
delete_sp_list_item(
item_id = NULL,
sp_list_item = NULL,
...,
.id = "id",
list_name = NULL,
list_id = NULL,
sp_list = NULL,
site_url = NULL,
site = NULL,
confirm = TRUE,
call = caller_env()
)
delete_sp_list_items(
item_id = NULL,
...,
.id = "id",
sp_list = NULL,
filter = NULL,
confirm = TRUE,
.batch = getOption("sharepointr.batch", TRUE),
.progress = TRUE,
call = caller_env()
)Arguments
- item_id
ID value for list item or items to delete.
item_idcan also be a data frame with a column named with the.idvalue, a single named list record, or (fordelete_sp_list_items()) a list of named lists (one per item) where each record includes an element named with the.idvalue. Item IDs must be whole numbers or non-empty strings and are checked before any items are deleted.delete_sp_list_item()requires a single item ID.- sp_list_item
Optional. A SharePoint list item object to delete.
- ...
For
delete_sp_list_item(), must be empty. Fordelete_sp_list_items(), additional parameters passed toget_sp_list()ifsp_listisNULL.- .id
Name of column (if
item_idis a data frame) or element (ifitem_idis a list of records) to use for item ID values. Defaults to "id".- list_name, list_id
SharePoint List name or ID string.
- sp_list
A
ms_listobject. If supplied,list_name,list_id,site_url,site,drive_name,drive_id,drive, and any additional parameters passed to...are all ignored.- site_url
A SharePoint site URL in the format "https://[tenant name].sharepoint.com/sites/[site name]". Any SharePoint item or document URL can also be parsed to build a site URL using the tenant and site name included in the URL.
- site
A
ms_siteobject. Ifsiteis supplied,site_url,site_name, andsite_idare ignored.- confirm
If
TRUE(default), user confirmation is required to delete items.- call
The execution environment of a currently running function, e.g.
caller_env(). The function will be mentioned in error messages as the source of the error. See thecallargument ofabort()for more information.- filter
Optional. A string with an OData filter expression used to find the items to delete if
item_idisNULL. Can't be supplied withitem_id. Seelist_sp_list_items().- .batch
If
TRUE(default), items are sent with Microsoft Graph$batchrequests (up to 20 items per request), which is much faster than a separate request for each item. Requests throttled by the Graph API or failing with a temporary error (e.g. "Database is read only") are retried up to 5 times after the requested delay (or an increasing delay of up to 60 seconds). If any items fail, the remaining items are still sent and the error lists the failed items with the HTTP status. IfFALSE, a separate request is sent for each item and the first failed item is an error. Useoptions(sharepointr.batch = FALSE)to change the default for the session. In either case, requests are sent in parallel ifmirai::daemons()are set (seepurrr::in_parallel()). Forcreate_sp_list_items(), items sent in a$batchrequest (or in parallel) may be created in a different order thandata, so new item IDs may not follow the order ofdata. Use.batch = FALSE(without daemons) if item IDs must follow the order ofdata.- .progress
Whether to show a progress bar. Use
TRUEto turn on a basic progress bar, use a string to give it a name, or see progress_bars for more details.