get_sp_item() wraps the get_item method for ms_drive objects and
returns a ms_drive_item object by default. get_sp_item_properties() uses
the get_item_properties method (also available by setting properties = TRUE for get_sp_item()).
Additional parameters in ... are passed to get_sp_drive() by
get_sp_item() or to get_sp_item() by get_sp_item_properties() or
delete_sp_item().
Usage
get_sp_item(
path = NULL,
item_id = NULL,
item_url = NULL,
...,
drive_name = NULL,
drive_id = NULL,
drive = NULL,
site_url = NULL,
properties = FALSE,
as_data_frame = FALSE,
call = caller_env()
)
get_sp_item_properties(
path = NULL,
item_id = NULL,
item_url = NULL,
...,
drive = NULL,
drive_name = NULL,
drive_id = NULL,
site_url = NULL,
as_data_frame = FALSE,
call = caller_env()
)Arguments
- path
A SharePoint file URL or the relative path to a file located in a SharePoint drive. If input is a relative path, the string should not include the drive name. If input is a shared file URL, the text "Shared " is removed from the start of the SharePoint drive name by default. If file is a document URL, the
default_drive_nameargument is used as thedrive_nameand theitem_idis extracted from the URL.- item_id
A SharePoint item ID passed to the
itemidparameter of theget_itemmethod forms_driveobjects.- item_url
A SharePoint item URL used to parse the item ID, drive name, and site URL.
- ...
Arguments passed on to
get_sp_drivedrive_name,drive_idSharePoint Drive name or ID passed to
get_drivemethod for SharePoint site object.drive_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.siteA
ms_siteobject. Ifsiteis supplied,site_url,site_name, andsite_idare ignored.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.
- drive_name, drive_id
SharePoint drive name or ID.
- drive
A
ms_driveobject. If drive is supplied,drive_name,site_url, and any additional parameters passed to...are 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.
- properties
If
TRUE, use theget_item_propertiesmethod and return item properties instead of the item.- as_data_frame
If
TRUE, return a data frame. IfFALSE(default), return ams_itemorms_item_propertiesobject.- 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.
Examples
sp_item_url <- "<SharePoint item url>"
if (is_sp_url(sp_item_url)) {
get_sp_item(
item_url = sp_item_url
)
}