Title: | Read and Write from SharePoint Sites |
---|---|
Description: | A R package extending Microsoft365R to make it easier to read, write, and work with SharePoint items, lists, and plans. |
Authors: | Eli Pousson [aut, cre, cph] |
Maintainer: | Eli Pousson <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0.9000 |
Built: | 2024-11-20 06:06:48 UTC |
Source: | https://github.com/elipousson/sharepointr |
AzureR_config_ls()
uses rappdirs::user_config_dir()
and fs::dir_ls()
to
list files from the AzureR configuration directory. AzureR_config_delete()
uses fs::file_delete()
to remove the "graph_logins.json" configuration file
if needed. Use this function with caution but it may be an option to address
a "Unable to refresh token" error.
AzureR_config_ls(path = NULL, glob = "*.json") AzureR_config_delete(path = NULL, filename = "graph_logins.json")
AzureR_config_ls(path = NULL, glob = "*.json") AzureR_config_delete(path = NULL, filename = "graph_logins.json")
path |
Path to configuration directory for AzureR package where the JSON
file for graph_logins is stored. If |
glob |
A wildcard aka globbing pattern (e.g. |
filename |
Filename to delete from configuration directory. Defaults to
"graph_logins.json". Set to |
Create or update list items
create_sp_list_items( data, list_name = NULL, list_id = NULL, sp_list = NULL, ..., allow_display_nm = TRUE, .id = "id", site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, check_fields = TRUE, sync_fields = FALSE, strict = FALSE, call = caller_env() ) update_sp_list_items( data, list_name = NULL, list_id = NULL, sp_list = NULL, ..., .id = "id", allow_display_nm = TRUE, call = caller_env() ) update_sp_list_item( ..., .data = NULL, id = NULL, sp_list_item = NULL, na_fields = c("drop", "replace"), list_name = NULL, list_id = NULL, sp_list = NULL, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() )
create_sp_list_items( data, list_name = NULL, list_id = NULL, sp_list = NULL, ..., allow_display_nm = TRUE, .id = "id", site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, check_fields = TRUE, sync_fields = FALSE, strict = FALSE, call = caller_env() ) update_sp_list_items( data, list_name = NULL, list_id = NULL, sp_list = NULL, ..., .id = "id", allow_display_nm = TRUE, call = caller_env() ) update_sp_list_item( ..., .data = NULL, id = NULL, sp_list_item = NULL, na_fields = c("drop", "replace"), list_name = NULL, list_id = NULL, sp_list = NULL, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() )
data |
Required. A data frame to import as items to the supplied or identified SharePoint list. |
list_name , list_id
|
SharePoint List name or ID string. |
sp_list |
A |
... |
Additional parameters passed to |
allow_display_nm |
If |
.id |
Name of column in data to use for item ID values. Defaults to "id". |
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 |
drive_name , drive_id
|
SharePoint Drive name or ID passed to |
drive |
A |
check_fields |
If |
sync_fields |
If |
strict |
Not yet implemented as of 2024-08-12. If |
call |
The execution environment of a currently
running function, e.g. |
.data |
A list or data frame with fields to update. |
sp_list_item |
Optional. A SharePoint list item object to use. |
na_fields |
How to handle |
Validation of data with with create_sp_list_items()
The handling of item creation when column names in data
do not match the
fields names in the supplied list includes a few options:
If no names in data match fields in the list, the function errors and lists the field names.
If all names in data match fields in the list the records are created. Any fields that do not have corresponding names in data remain blank.
If any names in data do not match fields in the list, by default, those columns are dropped before adding items to the list.
If strict = TRUE
and any names in data to not match fields, the function errors.
sp_list_url <- "<SharePoint List URL with a Name field>" if (is_sp_url(sp_list_url)) { create_sp_list_items( data = data.frame( Name = c("Jim", "Jane", "Jayden") ), list_name = sp_list_url ) }
sp_list_url <- "<SharePoint List URL with a Name field>" if (is_sp_url(sp_list_url)) { create_sp_list_items( data = data.frame( Name = c("Jim", "Jane", "Jayden") ), list_name = sp_list_url ) }
delete_sp_item()
deletes items including files and directories using the
delete
method for . By default confirm = TRUE
, which requires the user to
respond to a prompt: "Do you really want to delete the drive item ...?
(yes/No/cancel)" to continue.
delete_sp_item( path = NULL, confirm = TRUE, by_item = FALSE, ..., item_id = NULL, item_url = NULL, item = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, site_url = NULL, call = caller_env() )
delete_sp_item( path = NULL, confirm = TRUE, by_item = FALSE, ..., item_id = NULL, item_url = NULL, item = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, site_url = NULL, call = caller_env() )
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 |
confirm |
If |
by_item |
For business OneDrive or SharePoint document libraries, you
may need to set |
... |
Arguments passed on to
|
item_id |
A SharePoint item ID passed to the |
item_url |
A SharePoint item URL used to parse the item ID, drive name, and site URL. |
item |
A |
drive_name , drive_id
|
SharePoint drive name or ID. |
drive |
A |
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. |
call |
The execution environment of a currently
running function, e.g. |
Trouble-shooting errors
If you get the error: "The resource you are attempting to access is locked", you or another user may have the file or a file within the directory open for editing. Close the file and try deleting the item again.
If you get the error: "Request was cancelled by event received. If attempting
to delete a non-empty folder, it's possible that it's on hold." set by_item = TRUE
and try again.
download_sp_item()
wraps the download
method for SharePoint items making
it easier to download items based on a shared file URL or document URL.
download_sp_item( path = NULL, new_path = "", ..., item_id = NULL, item_url = NULL, item = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, site_url = NULL, dest = NULL, overwrite = FALSE, recursive = FALSE, parallel = FALSE, call = caller_env() ) download_sp_file(file, new_path = "", ..., call = caller_env())
download_sp_item( path = NULL, new_path = "", ..., item_id = NULL, item_url = NULL, item = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, site_url = NULL, dest = NULL, overwrite = FALSE, recursive = FALSE, parallel = FALSE, call = caller_env() ) download_sp_file(file, new_path = "", ..., call = caller_env())
path , file
|
Required. A SharePoint shared file URL, document URL, or, if
|
new_path |
Path to directory for downloaded item. Optional if |
... |
Arguments passed on to
|
item_id |
A SharePoint item ID passed to the |
item_url |
A SharePoint item URL used to parse the item ID, drive name, and site URL. |
item |
A |
drive_name , drive_id
|
SharePoint drive name or ID. |
drive |
A |
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. |
dest , overwrite , recursive , parallel
|
Parameters passed to |
call |
The execution environment of a currently
running function, e.g. |
The default value for path
is ""
so, by default, SharePoint items are
downloaded to the current working directory. Set overwrite = TRUE
to allow
this function to overwrite an existing file. download_sp_file()
is
identical except for the name of the path parameter (which is file instead of
path).
Note, if the selected item is a folder and recurse = TRUE
, it may
take some time to download the enclosed items and {Microsoft365R}
does not
provide a progress bar for that operation.
Invisibly returns the input dest
or the dest
parsed from the
input path or item properties.
If provided with a vector of paths or a vector of item ID values,
download_sp_item()
can execute a batch download on a set of files or
folders. Make sure to supply a vector to new_path
or dest
vector with the
directory names or file names to use as a destination for the downloads. With
either option, you must supply a drive
, a drive_name
and site
, or a
drive_url
. You can also pass a bare list of items and the value for the
dest
can be inferred from the item properties.
# Download a single directory sp_dir_url <- "<SharePoint directory url>" new_path <- "local file path" if (is_sp_url(sp_dir_url)) { download_sp_item( sp_dir_url, new_path = new_path, recursive = TRUE ) } # Batch download multiple directories from a SharePoint Drive sp_drive_url <- "<SharePoint Drive url>" if (is_sp_url(sp_drive_url)) { drive <- get_sp_drive(drive_name = sp_drive_url) drive_dir_list <- sp_dir_info( drive = drive, recurse = TRUE, type = "dir" ) download_sp_item( item_id = drive_dir_list$id, dest = drive_dir_list$name, recursive = TRUE, drive = drive ) }
# Download a single directory sp_dir_url <- "<SharePoint directory url>" new_path <- "local file path" if (is_sp_url(sp_dir_url)) { download_sp_item( sp_dir_url, new_path = new_path, recursive = TRUE ) } # Batch download multiple directories from a SharePoint Drive sp_drive_url <- "<SharePoint Drive url>" if (is_sp_url(sp_drive_url)) { drive <- get_sp_drive(drive_name = sp_drive_url) drive_dir_list <- sp_dir_info( drive = drive, recurse = TRUE, type = "dir" ) download_sp_item( item_id = drive_dir_list$id, dest = drive_dir_list$name, recursive = TRUE, drive = drive ) }
download_sp_list()
downloads a SharePoint list to a CSV or XLSX file.
download_sp_list( ..., new_path = "", sp_list = NULL, fileext = "csv", keep_list_cols = c("createdBy", "lastModifiedBy"), call = caller_env() )
download_sp_list( ..., new_path = "", sp_list = NULL, fileext = "csv", keep_list_cols = c("createdBy", "lastModifiedBy"), call = caller_env() )
... |
Arguments passed on to
|
new_path |
Optional path to new file. If not |
sp_list |
SharePoint list object. If supplied, all parameters supplied
to |
fileext |
File extension to use for output file. Must be |
keep_list_cols |
Column names for those columns to maintain in a list format instead of attempting to convert to a character vector. |
call |
The execution environment of a currently
running function, e.g. |
get_sp_group()
gets the group associated with an individual site using the
get_group
method. list_sp_group_members()
lists members in the group.
Note that, as of February 1, 2024, the returned member data frame when
as_data_frame = TRUE
contains a large number of list columns that could be
coerced into character columns. This should be addressed in a later update.
get_sp_group( site_url = NULL, site_name = NULL, site_id = NULL, ..., site = NULL, call = caller_env() ) list_sp_group_members( site_url = NULL, site_name = NULL, site_id = NULL, ..., as_data_frame = TRUE, call = caller_env() )
get_sp_group( site_url = NULL, site_name = NULL, site_id = NULL, ..., site = NULL, call = caller_env() ) list_sp_group_members( site_url = NULL, site_name = NULL, site_id = NULL, ..., as_data_frame = TRUE, call = caller_env() )
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_name , site_id
|
Site name or ID of the SharePoint site as an
alternative to the SharePoint site URL. Exactly one of |
... |
Additional parameters passed to |
site |
A |
call |
The execution environment of a currently
running function, e.g. |
as_data_frame |
If |
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()
.
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() )
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() )
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 |
item_id |
A SharePoint item ID passed to the |
item_url |
A SharePoint item URL used to parse the item ID, drive name, and site URL. |
... |
Arguments passed on to
|
drive_name , drive_id
|
SharePoint drive name or ID. |
drive |
A |
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 |
as_data_frame |
If |
call |
The execution environment of a currently
running function, e.g. |
sp_item_url <- "<SharePoint item url>" if (is_sp_url(sp_item_url)) { get_sp_item( item_url = sp_item_url ) }
sp_item_url <- "<SharePoint item url>" if (is_sp_url(sp_item_url)) { get_sp_item( item_url = sp_item_url ) }
list_sp_drives()
loads a SharePoint site uses the list_drives
method to
returns a data frame with a list column or ms_drive
objects or, if
as_data_frame = FALSE
. This is helpful if a drive has been renamed and
can't easily be identified using a Drive URL alone.
list_sp_drives( ..., site = NULL, filter = NULL, n = NULL, as_data_frame = TRUE, call = caller_env() )
list_sp_drives( ..., site = NULL, filter = NULL, n = NULL, as_data_frame = TRUE, call = caller_env() )
... |
Arguments passed on to
|
site |
A |
filter |
Filter to apply to query |
n |
Max number of drives to return |
as_data_frame |
If |
call |
The execution environment of a currently
running function, e.g. |
This is an implementation of a new method for a ms_item
object using the
do_operation
method directly. The intent is to add a list_versions method
back to the Microsoft365R package which may include changes to the
functionality and output of this function.
list_sp_item_versions(..., sp_item = NULL, as_data_frame = TRUE)
list_sp_item_versions(..., sp_item = NULL, as_data_frame = TRUE)
... |
Arguments passed on to
|
sp_item |
SharePoint item to get versions for. Additional parameters
passed to |
as_data_frame |
If |
A data frame if as_data_frame = TRUE
or a list if FALSE
.
list_sp_pages()
returns a list of SharePoint pages associated with a
specified SharePoint site. get_sp_page()
returns a single SharePoint page.
list_sp_pages( ..., site = NULL, page_type = c("sitePage", "page"), as_data_frame = TRUE, call = caller_env() ) get_sp_page(page_url = NULL, page_id = NULL, ..., site = NULL)
list_sp_pages( ..., site = NULL, page_type = c("sitePage", "page"), as_data_frame = TRUE, call = caller_env() ) get_sp_page(page_url = NULL, page_id = NULL, ..., site = NULL)
... |
Arguments passed on to
|
site |
Optional |
page_type |
Page type to request. One of "sitePage" or "page". |
as_data_frame |
If |
call |
The execution environment of a currently
running function, e.g. |
page_url , page_id
|
SharePoint page URL or ID. |
sp_dir_create()
is a wrapper for the create_folder
method that handles
character vectors. If drive_name
is a folder URL and relative
is TRUE
,
the values for path
are appended to the file path parsed from the url.
sp_dir_create( path, ..., drive_name = NULL, drive_id = NULL, drive = NULL, relative = FALSE, call = caller_env() )
sp_dir_create( path, ..., drive_name = NULL, drive_id = NULL, drive = NULL, relative = FALSE, call = caller_env() )
path |
A character vector of one or more paths. |
... |
Arguments passed on to
|
drive_name , drive_id
|
SharePoint Drive name or ID passed to |
drive |
A |
relative |
If |
call |
The execution environment of a currently
running function, e.g. |
drive_url <- "<link to SharePoint drive>" if (is_sp_url(drive_url)) { sp_dir_create( path = "parent_folder/subfolder", drive_name = drive_url ) sp_dir_create( path = c("subfolder1", "subfolder2", "subfolder3"), relative = "parent_folder", drive_name = drive_url ) } dir_url <- "<link to SharePoint directory>" if (is_sp_url(dir_url)) { sp_dir_create( path = c("subfolder1", "subfolder2", "subfolder3"), drive_name = dir_url, relative = TRUE ) }
drive_url <- "<link to SharePoint drive>" if (is_sp_url(drive_url)) { sp_dir_create( path = "parent_folder/subfolder", drive_name = drive_url ) sp_dir_create( path = c("subfolder1", "subfolder2", "subfolder3"), relative = "parent_folder", drive_name = drive_url ) } dir_url <- "<link to SharePoint directory>" if (is_sp_url(dir_url)) { sp_dir_create( path = c("subfolder1", "subfolder2", "subfolder3"), drive_name = dir_url, relative = TRUE ) }
sp_dir_info()
is a wrapper for the list_files
method with some additional
features based on fs::dir_info()
. sp_dir_ls()
returns a character vector
and does not yet include support for the recurse
argument. If
{fs}
is installed, the size column is formatted using fs::as_fs_bytes()
and an additional "type" factor column is added with values for directory and
file.
sp_dir_info( path = NULL, ..., info = "partial", full_names = TRUE, pagesize = 1000, drive_name = NULL, drive_id = NULL, drive = NULL, recurse = FALSE, type = "any", regexp = NULL, invert = FALSE, perl = FALSE, call = caller_env() ) sp_dir_ls( path = NULL, ..., full_names = FALSE, pagesize = 1000, drive_name = NULL, drive_id = NULL, drive = NULL, type = "any", regexp = NULL, invert = FALSE, perl = FALSE, call = caller_env() )
sp_dir_info( path = NULL, ..., info = "partial", full_names = TRUE, pagesize = 1000, drive_name = NULL, drive_id = NULL, drive = NULL, recurse = FALSE, type = "any", regexp = NULL, invert = FALSE, perl = FALSE, call = caller_env() ) sp_dir_ls( path = NULL, ..., full_names = FALSE, pagesize = 1000, drive_name = NULL, drive_id = NULL, drive = NULL, type = "any", regexp = NULL, invert = FALSE, perl = FALSE, call = caller_env() )
path |
Path to directory or folder. SharePoint folder URLs are allowed.
If |
... |
Arguments passed on to
|
info |
The information to return: "partial", "name" or "all". If "partial", a data frame is returned containing the name, size, ID and whether the item is a file or folder. If "all", a data frame is returned containing all the properties for each item (this can be large). |
full_names |
If |
pagesize |
Maximum number of items to return. Defaults to 1000. Decrease if you are experiencing timeouts. |
drive_name , drive_id
|
SharePoint Drive name or ID passed to |
drive |
A |
recurse |
If |
type |
Type of item to return. Can be "any", "file", or "directory".
"directory" is not a supported option for |
regexp |
Regular expression passed to |
invert |
logical. If |
perl |
logical. Should Perl-compatible regexps be used? |
call |
The execution environment of a currently
running function, e.g. |
dir_url <- "<link to SharePoint directory or drive>" if (is_sp_url(dir_url)) { sp_dir_info( path = dir_url ) sp_dir_ls( path = dir_url ) }
dir_url <- "<link to SharePoint directory or drive>" if (is_sp_url(dir_url)) { sp_dir_info( path = dir_url ) sp_dir_ls( path = dir_url ) }
get_sp_drive()
wraps the get_drive
method returns a ms_drive
object.
cache_sp_drive()
allows you to cache a default SharePoint drive for use by
other functions. Additional parameters in ...
are passed to
get_sp_drive()
.
get_sp_drive( drive_name = NULL, drive_id = NULL, drive_url = NULL, properties = FALSE, ..., site_url = NULL, site = NULL, default_drive_name = getOption("sharepointr.default_drive_name", "Documents"), cache = FALSE, refresh = TRUE, overwrite = FALSE, cache_file = getOption("sharepointr.cache_file_drive", "sp_drive.rds"), call = caller_env() ) cache_sp_drive( ..., drive = NULL, cache_file = getOption("sharepointr.cache_file_drive", "sp_drive.rds"), overwrite = FALSE, call = caller_env() )
get_sp_drive( drive_name = NULL, drive_id = NULL, drive_url = NULL, properties = FALSE, ..., site_url = NULL, site = NULL, default_drive_name = getOption("sharepointr.default_drive_name", "Documents"), cache = FALSE, refresh = TRUE, overwrite = FALSE, cache_file = getOption("sharepointr.cache_file_drive", "sp_drive.rds"), call = caller_env() ) cache_sp_drive( ..., drive = NULL, cache_file = getOption("sharepointr.cache_file_drive", "sp_drive.rds"), overwrite = FALSE, call = caller_env() )
drive_name , drive_id
|
SharePoint Drive name or ID passed to |
drive_url |
A SharePoint Drive URL to parse for a Drive name and other
information. If |
properties |
If |
... |
Arguments passed on to
|
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 |
default_drive_name |
Drive name string used only if input is a document
URL and drive name is not part of the URL. Defaults to
|
cache |
If |
refresh |
If |
overwrite |
If |
cache_file |
File name for cached drive if |
call |
The execution environment of a currently
running function, e.g. |
drive |
A |
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.
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", "visible"), sync_fields = FALSE, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() ) delete_sp_list( list_name = NULL, list_id = NULL, sp_list = NULL, confirm = TRUE, ..., site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() )
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", "visible"), sync_fields = FALSE, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() ) delete_sp_list( list_name = NULL, list_id = NULL, sp_list = NULL, confirm = TRUE, ..., site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() )
list_name , list_id
|
SharePoint List name or ID string. |
... |
Arguments passed on to
|
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 |
drive_name , drive_id
|
SharePoint Drive name or ID passed to |
drive |
A |
metadata |
If |
as_data_frame |
If |
call |
The execution environment of a currently
running function, e.g. |
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 |
sp_list |
A |
keep |
One of "all" (default), "editable", "visible" (not yet supported). Argument determines if the returned list metadata includes read only columns or hidden columns. |
sync_fields |
If |
confirm |
If |
A data frame as_data_frame = TRUE
or a ms_list
object (or list
of ms_list
objects) if FALSE
.
list_sp_list_items()
lists sp_list
items. Additional functions should be
completed for the get_item
, create_item
, update_item
, and delete_item
methods documented in Microsoft365R::ms_list.
list_sp_list_items( list_name = NULL, list_id = NULL, sp_list = NULL, ..., filter = NULL, select = NULL, all_metadata = FALSE, as_data_frame = TRUE, display_nm = c("drop", "label", "replace"), name_repair = "unique", pagesize = 5000, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() ) get_sp_list_item( id, list_name = NULL, list_id = NULL, sp_list = NULL, ..., site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() )
list_sp_list_items( list_name = NULL, list_id = NULL, sp_list = NULL, ..., filter = NULL, select = NULL, all_metadata = FALSE, as_data_frame = TRUE, display_nm = c("drop", "label", "replace"), name_repair = "unique", pagesize = 5000, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() ) get_sp_list_item( id, list_name = NULL, list_id = NULL, sp_list = NULL, ..., site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() )
list_name , list_id
|
SharePoint List name or ID string. |
sp_list |
A |
... |
Arguments passed on to
|
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. |
select |
A character vector of column names to include in the returned
data frame of list items. If |
all_metadata |
If |
as_data_frame |
If |
display_nm |
Option of "drop" (default), "label", or "replace". If
"drop", display names are not accessed or used. If "label", display names
are used to label matching columns in the returned data frame. If
"replace", display names replace column names in the returned data frame.
When working with the last option, the |
name_repair |
Passed to repair argument of |
pagesize |
Number of list items to return. Reduce from default of 5000 is experiencing timeouts. |
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 |
drive_name , drive_id
|
SharePoint Drive name or ID passed to |
drive |
A |
call |
The execution environment of a currently
running function, e.g. |
id |
Required. A SharePoint list item ID typically an integer for the record number starting from 1 with the first record. |
get_sp_plan()
returns a single ms_plan
object using the get_plan
method. list_sp_plans()
returns a data frame with plan properties or a list
of ms_plan
objects.
get_sp_plan( plan_title = NULL, plan_id = NULL, ..., site = NULL, site_url = NULL, as_data_frame = FALSE, call = caller_env() ) list_sp_plans( ..., filter = NULL, n = NULL, site = NULL, as_data_frame = TRUE, call = caller_env() )
get_sp_plan( plan_title = NULL, plan_id = NULL, ..., site = NULL, site_url = NULL, as_data_frame = FALSE, call = caller_env() ) list_sp_plans( ..., filter = NULL, n = NULL, site = NULL, as_data_frame = TRUE, call = caller_env() )
plan_title , plan_id
|
Planner title or ID. Exactly one of the two arguments must be supplied. |
... |
Additional arguments passed to |
site |
A |
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. |
as_data_frame |
If |
call |
The execution environment of a currently
running function, e.g. |
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 |
For get_sp_plan()
, a ms_plan
class object or a 1 row data frame
with a "ms_plan" column.
For list_sp_plans()
, A list of ms_plan
class objects or a data
frame with a list column named "ms_plan".
list_sp_plan_buckets()
lists the buckets for a specified plan using the
list_buckets
method.
list_sp_plan_buckets( plan_title = NULL, plan_id = NULL, ..., filter = NULL, n = NULL, plan = NULL, as_data_frame = TRUE, call = caller_env() )
list_sp_plan_buckets( plan_title = NULL, plan_id = NULL, ..., filter = NULL, n = NULL, plan = NULL, as_data_frame = TRUE, call = caller_env() )
plan_title , plan_id
|
Planner title or ID. Exactly one of the two arguments must be supplied. |
... |
Additional arguments passed to |
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 |
plan |
A |
as_data_frame |
If |
call |
The execution environment of a currently
running function, e.g. |
For list_sp_plan_buckets()
, a list of ms_plan_bucket
class
objects or a data frame with a list column named "ms_plan_task".
get_sp_site()
is a wrapper for Microsoft365R::get_sharepoint_site()
and
returns a ms_site
object. cache_sp_site()
allows you to cache a default
SharePoint site for use by other functions.
get_sp_site( site_url = NULL, site_name = NULL, site_id = NULL, ..., cache = FALSE, refresh = TRUE, overwrite = FALSE, cache_file = getOption("sharepointr.cache_file_site", "sp_site.rds"), call = caller_env() ) cache_sp_site( ..., site = NULL, cache_file = getOption("sharepointr.cache_file_site", "sp_site.rds"), cache_dir = "sharepointr.cache_dir", overwrite = FALSE, call = caller_env() )
get_sp_site( site_url = NULL, site_name = NULL, site_id = NULL, ..., cache = FALSE, refresh = TRUE, overwrite = FALSE, cache_file = getOption("sharepointr.cache_file_site", "sp_site.rds"), call = caller_env() ) cache_sp_site( ..., site = NULL, cache_file = getOption("sharepointr.cache_file_site", "sp_site.rds"), cache_dir = "sharepointr.cache_dir", overwrite = FALSE, call = caller_env() )
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_name , site_id
|
Site name or ID of the SharePoint site as an
alternative to the SharePoint site URL. Exactly one of |
... |
Arguments passed on to
|
cache |
If |
refresh |
If |
overwrite |
If |
cache_file |
File name for cached file if |
call |
The execution environment of a currently
running function, e.g. |
site |
A |
cache_dir |
Cache directory. By default, uses an environmental variable
named "sharepointr.cache_dir". If "sharepointr.cache_dir" is not set, the
cache directory is set to |
get_sp_task()
gets an individual planner task using the get_task
method.
list_sp_tasks()
lists the tasks for a specified plan using the list_tasks
method.
get_sp_task( task_title = NULL, task_id = NULL, ..., plan_title = NULL, plan_id = NULL, plan = NULL, as_data_frame = FALSE, call = caller_env() ) list_sp_tasks( plan_title = NULL, plan_id = NULL, ..., filter = NULL, n = NULL, plan = NULL, as_data_frame = TRUE, call = caller_env() )
get_sp_task( task_title = NULL, task_id = NULL, ..., plan_title = NULL, plan_id = NULL, plan = NULL, as_data_frame = FALSE, call = caller_env() ) list_sp_tasks( plan_title = NULL, plan_id = NULL, ..., filter = NULL, n = NULL, plan = NULL, as_data_frame = TRUE, call = caller_env() )
task_title , task_id
|
Planner task title and id. Exactly one of
|
... |
Additional arguments passed to |
plan_title , plan_id
|
Planner title or ID. Exactly one of the two arguments must be supplied. |
plan |
A |
as_data_frame |
If |
call |
The execution environment of a currently
running function, e.g. |
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 |
For list_sp_tasks()
, a list of ms_plan_task
class objects or a
data frame with a list column named "ms_plan_task".
upload_sp_item()
wraps the upload_folder
and upload_file
method for
ms_drive
objects.
upload_sp_item( file = NULL, dest, ..., src = NULL, overwrite = FALSE, drive_name = NULL, drive_id = NULL, drive = NULL, blocksize = 327680000, recursive = FALSE, parallel = FALSE, call = caller_env() ) upload_sp_items(file = NULL, dest, ..., src = NULL, call = caller_env())
upload_sp_item( file = NULL, dest, ..., src = NULL, overwrite = FALSE, drive_name = NULL, drive_id = NULL, drive = NULL, blocksize = 327680000, recursive = FALSE, parallel = FALSE, call = caller_env() ) upload_sp_items(file = NULL, dest, ..., src = NULL, call = caller_env())
file |
Path for file or directory to upload. Optional if |
dest |
Destination on SharePoint for file to upload. SharePoint folder URLs are supported. |
... |
Additional parameters passed to |
src |
Data source path passed to |
overwrite |
If |
drive_name , drive_id
|
SharePoint drive name or ID. |
drive |
A |
blocksize , recursive , parallel
|
Additional parameters passed to
|
call |
The execution environment of a currently
running function, e.g. |