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 = deprecated(),
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("visible", "all", "editable", "external"),
select = NULL,
site_url = NULL,
site = NULL,
drive_name = NULL,
drive_id = NULL,
drive = NULL,
as_data_frame = TRUE,
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. Useget_sp_list_metadata()withkeep = "visible"instead.- 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 "visible" (default), "all", "editable", or "external" (non-internal fields). Argument determines if the returned list metadata includes read only columns or hidden columns. Only "all" requests hidden columns, which the Graph API omits by default, so "visible", "editable", and "external" never include hidden columns.
- select
Optional character vector of columnDefinition properties to return, e.g.
c("name", "displayName"), to reduce the size of the response. Must be one of the columnDefinition properties documented by the Graph API, including the column type properties such as "text" or "lookup". Properties required bykeepare added: "hidden" for "all", "readOnly" for "editable", and "name" for "external". IfNULL(default), the Graph API default properties are returned, except thatkeep = "all"requests every known columnDefinition property (and "hidden") because the API only returns hidden columns when a selection is made. A property that the package does not list is not returned bykeep = "all".