get_sp_list() is a wrapper for the get_list and list_items methods.
This function is still under development and does not support the URL parsing
used by get_sp_item(). list_sp_lists() returns all lists for a SharePoint
site or drive as a list or data frame. Note, when using filter with
get_sp_list(), names used in the expression must be prefixed with "fields/"
to distinguish them from item metadata.
Usage
get_sp_list(
list_name = NULL,
list_id = NULL,
...,
site_url = NULL,
site = NULL,
drive_name = NULL,
drive_id = NULL,
drive = NULL,
metadata = FALSE,
as_data_frame = FALSE,
call = caller_env()
)
list_sp_lists(
site_url = NULL,
filter = NULL,
n = Inf,
...,
site = NULL,
drive_name = NULL,
drive_id = NULL,
drive = NULL,
as_data_frame = TRUE,
call = caller_env()
)
get_sp_list_metadata(
list_name = NULL,
list_id = NULL,
sp_list = NULL,
...,
keep = c("all", "editable", "external"),
sync_fields = FALSE,
site_url = NULL,
site = NULL,
drive_name = NULL,
drive_id = NULL,
drive = NULL,
call = caller_env()
)Arguments
- list_name, list_id
SharePoint List name or ID string.
- ...
Arguments passed on to
get_sp_drivedrive_urlA SharePoint Drive URL to parse for a Drive name and other information. If
drive_nameis a URL, it is used asdrive_url.default_drive_nameDrive name string used only if input is a document URL and drive name is not part of the URL. Defaults to
getOption("sharepointr.default_drive_name", "Documents")cacheIf
TRUE, cache drive to a file usingcache_sp_drive().refreshIf
TRUE, get a new drive even if the existing drive is cached as a local option. IfFALSE, use the cachedms_driveobject if it exists.cache_fileFile name for cached drive or site. Default
NULL.overwriteIf
TRUE, replace the existing cached object named bycache_filewith the new object. IfFALSE, error if a cached file with the samecache_filename already exists.
- 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.- drive_name, drive_id
SharePoint Drive name or ID passed to
get_drivemethod for SharePoint site object.- drive
A
ms_driveobject. Ifdriveis supplied,drive_nameanddrive_idare ignored.- metadata
If
TRUE,get_sp_list()applies theget_column_infomethod to the returned SharePoint list and returns a data frame with column metadata for the list.- as_data_frame
If
TRUE, return a data frame with a "ms_list" column.get_sp_list()returns a 1 row data frame andlist_sp_lists()returns a data frame with n rows or all lists available for the SharePoint site or drive. Defaults toFALSE. Ignored ismetadata = TRUEas list metadata is always returned as a data frame.- 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
A string with an OData expression apply as a filter to the results. Learn more in the Microsoft Graph API documentation on using filter query parameters.
- n
Maximum number of lists, plans, tasks, or other items to return. Defaults to
NULLwhich sets n toInf.- 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.- keep
One of "all" (default), "editable", "external" (non-internal fields). Argument determines if the returned list metadata includes read only columns or hidden columns.
- sync_fields
If
TRUE, use thesync_fieldsmethod to sync the fields of the localms_listobject with the fields of the SharePoint List source before retrieving list metadata.