| 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] (ORCID: <https://orcid.org/0000-0001-8280-1706>) |
| Maintainer: | Eli Pousson <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0.9000 |
| Built: | 2026-05-28 18:07:45 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 |
copy_column_definition_list(sp_list = NULL, ...)copy_column_definition_list(sp_list = NULL, ...)
sp_list |
A |
... |
Arguments passed on to
|
copy_column_definition_list() takes an existing SharePoint list and uses
the list metadata to create a column definition list that can be used to
create a new SharePoint list. Note: lookup columns retain the original lookup
list references so self-referencing lookup columns are copied as lookup
columns referencing the source list.
create_column_definition() builds a named list with the properties of the
columnDefinition resource type.
More information: https://learn.microsoft.com/en-us/graph/api/resources/columndefinition?view=graph-rest-1.0
create_column_definition( name, ..., .col_type = "text", enforce_unique = NULL, hidden = FALSE, deletable = NULL, indexed = NULL, sealed = NULL, propagate_changes = NULL, read_only = NULL, required = NULL, validation = NULL, default = get_column_default(), description = NULL, displayname = NULL, id = NULL ) create_text_column( name, ..., multiple_lines = NULL, append_changes = NULL, lines = NULL, max_length = NULL, text_type = c("plain", "richText") ) create_choice_column( name, choices, ..., allow_text = TRUE, display_as = c("dropDownMenu", "checkBoxes", "radioButtons"), allow_na = TRUE, na_replacement = "NA", split = NULL ) create_number_column( name, ..., decimals = "automatic", display_as = NULL, max = NULL, min = NULL ) create_datetime_column( name, ..., display_as = c("default", "friendly", "standard"), format = c("dateOnly", "dateTime") ) create_boolean_column(name, ...) create_currency_column(name, ..., locale = "en-us") create_calculated_column( name, ..., formula, format = c("dateOnly", "dateTime"), output_type = c("text", "boolean", "currency", "dateTime", "number") ) create_lookup_column( name, lookup_list_column, ..., lookup_list_id = NULL, lookup_list = NULL, allow_multiple = NULL, allow_unlimited_length = NULL, primary_lookup_column_id = NULL ) create_person_column( name, ..., allow_multiple = NULL, display_as = NULL, from_type = "peopleOnly" ) create_group_column( name, ..., allow_multiple = NULL, display_as = NULL, from_type = "peopleAndGroups" ) create_hyperlink_column(name, ..., is_picture = FALSE) create_picture_column(name, ..., is_picture = TRUE) create_thumbnail_column(name, ...) create_geolocation_column(name, ...) create_term_column(name, ..., allow_multiple = TRUE, show_full_name = NULL)create_column_definition( name, ..., .col_type = "text", enforce_unique = NULL, hidden = FALSE, deletable = NULL, indexed = NULL, sealed = NULL, propagate_changes = NULL, read_only = NULL, required = NULL, validation = NULL, default = get_column_default(), description = NULL, displayname = NULL, id = NULL ) create_text_column( name, ..., multiple_lines = NULL, append_changes = NULL, lines = NULL, max_length = NULL, text_type = c("plain", "richText") ) create_choice_column( name, choices, ..., allow_text = TRUE, display_as = c("dropDownMenu", "checkBoxes", "radioButtons"), allow_na = TRUE, na_replacement = "NA", split = NULL ) create_number_column( name, ..., decimals = "automatic", display_as = NULL, max = NULL, min = NULL ) create_datetime_column( name, ..., display_as = c("default", "friendly", "standard"), format = c("dateOnly", "dateTime") ) create_boolean_column(name, ...) create_currency_column(name, ..., locale = "en-us") create_calculated_column( name, ..., formula, format = c("dateOnly", "dateTime"), output_type = c("text", "boolean", "currency", "dateTime", "number") ) create_lookup_column( name, lookup_list_column, ..., lookup_list_id = NULL, lookup_list = NULL, allow_multiple = NULL, allow_unlimited_length = NULL, primary_lookup_column_id = NULL ) create_person_column( name, ..., allow_multiple = NULL, display_as = NULL, from_type = "peopleOnly" ) create_group_column( name, ..., allow_multiple = NULL, display_as = NULL, from_type = "peopleAndGroups" ) create_hyperlink_column(name, ..., is_picture = FALSE) create_picture_column(name, ..., is_picture = TRUE) create_thumbnail_column(name, ...) create_geolocation_column(name, ...) create_term_column(name, ..., allow_multiple = TRUE, show_full_name = NULL)
name |
Column name. |
... |
Additional arguments passed to |
.col_type |
Column type. Defaults to "text". Must be one of "boolean", "calculated", "choice", "currency", "dateTime", "lookup", "number", "personOrGroup", "text", "term", "hyperlinkOrPicture", "thumbnail", "contentApprovalStatus", or "geolocation". |
enforce_unique |
Enforce unique values in column. |
|
If |
|
deletable |
If |
indexed, sealed, propagate_changes, read_only, validation, id, show_full_name
|
Additional arguments used by |
required |
If |
default |
Default value set by helper |
description |
Column description. |
displayname |
Column display name. |
multiple_lines |
Logical. If |
append_changes |
Logical. If |
lines |
Whole number. |
max_length |
Whole number. Max length in number of characters. |
text_type |
One of |
choices |
A character vector of choice options. |
allow_text |
If |
display_as |
Value displayed as option. For |
allow_na |
If |
na_replacement |
Used as |
split |
character vector (or object which can be coerced to such)
containing regular expression(s) (unless |
decimals |
One of |
max, min
|
Minimum and maximum values allowed in number column. |
format |
|
locale |
Locale |
formula |
Required string with formula for calculated column definition.
See examples of common formulas in lists.
Reference existing columns using the display name enclosed in square
brackets. The formula must start with an equals sign |
output_type |
Value type returned by calculated formula. One of
|
lookup_list_column |
Name of lookup column in the lookup list to use. |
lookup_list_id, lookup_list
|
Lookup list ID string or "ms_list" class object with id value in list properties. |
allow_multiple |
If |
allow_unlimited_length |
If |
primary_lookup_column_id |
If column definition is for a secondary column, the primary lookup column ID must be supplied. |
from_type |
What type of resources to choose from. Defaults to
"peopleOnly" for |
is_picture |
Logical indicator for display of hyperlink value as link
( |
Display as options
Display as options vary by columnDefinition type. See documentation for more details:
personOrGroupColumn: https://learn.microsoft.com/en-us/graph/api/resources/personorgroupcolumn?view=graph-rest-1.0#displayas-options
choiceColumn: https://learn.microsoft.com/en-us/graph/api/resources/choicecolumn?view=graph-rest-1.0#properties
numberColumn: https://learn.microsoft.com/en-us/graph/api/resources/numbercolumn?view=graph-rest-1.0#properties
dateTimeColumn: https://learn.microsoft.com/en-us/graph/api/resources/datetimecolumn?view=graph-rest-1.0
create_text_column("TextColumn") fruit <- c("apple", "banana", "pear", "pineapple") create_choice_column("ChoiceColumn", fruit) create_number_column("NumberColumn") create_datetime_column("DatetimeColumn") create_calculated_column( name = "FormulaColumn", formula = "=[Text Column]" )create_text_column("TextColumn") fruit <- c("apple", "banana", "pear", "pineapple") create_choice_column("ChoiceColumn", fruit) create_number_column("NumberColumn") create_datetime_column("DatetimeColumn") create_calculated_column( name = "FormulaColumn", formula = "=[Text Column]" )
create_column_definition_list() is a vectorized version of
create_column_definition() that uses a list or data frame input to create
a list of column definitions. This list can be used as the fields argument
for create_sp_list().
create_column_definition_list(definitions, col_type = "text", ignore_na = TRUE)create_column_definition_list(definitions, col_type = "text", ignore_na = TRUE)
definitions |
A list or data frame with arguments to use in creation of column definitions. |
col_type |
Column type to use if not provided as a "type" column in the input definitions data frame. Allowed values include date and datetime, person, group, and personorgroup. Not case sensitive. |
ignore_na |
If |
definition_df <- data.frame( name = c("FirstColumn", "SecondColumn"), type = c("text", "number"), decimals = c(NA, 0), multiple_lines = c(TRUE, NA) ) create_column_definition_list(definition_df)definition_df <- data.frame( name = c("FirstColumn", "SecondColumn"), type = c("text", "number"), decimals = c(NA, 0), multiple_lines = c(TRUE, NA) ) create_column_definition_list(definition_df)
create_sp_list() allows the creation of a SharePoint list for a site. See:
https://learn.microsoft.com/en-us/graph/api/list-create?view=graph-rest-1.0&tabs=http
update_sp_list() allows the modification of the list display name and
description.
delete_sp_list() deletes an existing list and requires user confirmation by
default.
Notes on creating a SharePoint list:
Dashes ('"-"“) in list names are removed from the list name but retained in the list display name.
If your definition includes calculated columns, these columns may need to
be added after the list is initially created using
create_sp_list_column().
Notes on updating a SharePoint list:
The "Title" column type is always a "text" type column and can't be
changed.
create_sp_list( list_name, ..., description = NULL, columns = NULL, template = "genericList", content_types = NULL, hidden = NULL, title_definition = list(required = FALSE), site_url = NULL, site = NULL, call = caller_env() ) update_sp_list( list_name = NULL, list_id = NULL, sp_list = NULL, display_name = NULL, description = NULL, ..., 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() )create_sp_list( list_name, ..., description = NULL, columns = NULL, template = "genericList", content_types = NULL, hidden = NULL, title_definition = list(required = FALSE), site_url = NULL, site = NULL, call = caller_env() ) update_sp_list( list_name = NULL, list_id = NULL, sp_list = NULL, display_name = NULL, description = NULL, ..., 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 |
Required. List name used as |
... |
Additional parameters passed to |
description |
Optional description. |
columns |
Optional. Use |
template |
Type of template to use in creating the list. |
content_types |
Optional. Set |
|
Optional. Set |
|
title_definition |
Named list used to update the column definition of
the default |
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 |
call |
The execution environment of a currently
running function, e.g. |
list_id |
List ID for list to update or delete. |
sp_list |
A |
display_name |
Display name to replace existing display name. Used by
|
drive_name, drive_id
|
SharePoint Drive name or ID passed to |
drive |
A |
confirm |
If |
create_sp_list_column() adds a column to a SharePoint list and
delete_sp_list_column() removes a column to a SharePoint list.
update_sp_list_column() updates a column definition for an existing column
in a SharePoint list (but is not yet implemented).
create_sp_list_column( sp_list = NULL, ..., column_name = NULL, column_definition = NULL, list_name = NULL, site = NULL, site_url = NULL ) update_sp_list_column( sp_list = NULL, column_name = NULL, column_id = NULL, ..., list_name = NULL, column_definition = NULL, column_name_type = "name" ) delete_sp_list_column( sp_list = NULL, column_name = NULL, column_id = NULL, list_name = NULL, column_name_type = "name" )create_sp_list_column( sp_list = NULL, ..., column_name = NULL, column_definition = NULL, list_name = NULL, site = NULL, site_url = NULL ) update_sp_list_column( sp_list = NULL, column_name = NULL, column_id = NULL, ..., list_name = NULL, column_definition = NULL, column_name_type = "name" ) delete_sp_list_column( sp_list = NULL, column_name = NULL, column_id = NULL, list_name = NULL, column_name_type = "name" )
sp_list |
A |
... |
Arguments passed on to
|
column_name, column_id
|
Column ID for column to delete. |
column_definition |
List with column definition created with
|
list_name |
List name. Required if |
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. |
column_name_type |
"name" or "displayName". Used to match column ID so
column_name must be unique if |
See documentation: https://learn.microsoft.com/en-us/graph/api/list-post-columns?view=graph-rest-1.0&tabs=http
Create or update list items
create_sp_list_items( data, list_name = NULL, list_id = NULL, sp_list = NULL, ..., allow_display_nm = FALSE, .id = "id", site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, check_fields = TRUE, sync_fields = FALSE, create_list = FALSE, strict = FALSE, .progress = TRUE, call = caller_env() ) update_sp_list_items( data, list_name = NULL, list_id = NULL, sp_list = NULL, ..., .id = "id", allow_display_nm = FALSE, check_fields = TRUE, na_fields = c("drop", "replace"), drop_fields = c("ContentType", "Attachments"), .progress = TRUE, call = caller_env() ) update_sp_list_item( ..., .data = NULL, item_id = NULL, sp_list_item = NULL, .id = "id", check_fields = TRUE, na_fields = c("drop", "replace"), drop_fields = c("ContentType", "Attachments"), 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 = FALSE, .id = "id", site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, check_fields = TRUE, sync_fields = FALSE, create_list = FALSE, strict = FALSE, .progress = TRUE, call = caller_env() ) update_sp_list_items( data, list_name = NULL, list_id = NULL, sp_list = NULL, ..., .id = "id", allow_display_nm = FALSE, check_fields = TRUE, na_fields = c("drop", "replace"), drop_fields = c("ContentType", "Attachments"), .progress = TRUE, call = caller_env() ) update_sp_list_item( ..., .data = NULL, item_id = NULL, sp_list_item = NULL, .id = "id", check_fields = TRUE, na_fields = c("drop", "replace"), drop_fields = c("ContentType", "Attachments"), 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. If data is an sf object, the geometry column is
coerced to text using |
list_name, list_id
|
SharePoint List name or ID string. |
sp_list |
A |
... |
Additional parameters passed to |
allow_display_nm |
If |
.id |
Column or element name with |
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 |
create_list |
If |
strict |
Not yet implemented as of 2024-08-12. If |
.progress |
Whether to show a progress bar. Use |
call |
The execution environment of a currently
running function, e.g. |
na_fields |
How to handle |
drop_fields |
Column names to drop from |
.data |
A list or data frame with fields to update. |
item_id |
A SharePoint list item id. Either |
sp_list_item |
Optional. A SharePoint list item object to update. |
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 ) }
data_as_column_definition_list() is used to create a column definition list
based on an existing data frame. This function is used internally by
create_sp_list_items() when create_list = TRUE.
data_as_column_definition_list( data, ..., split = "|", ignore_na = TRUE, definitions_as = c("definition_list", "table") )data_as_column_definition_list( data, ..., split = "|", ignore_na = TRUE, definitions_as = c("definition_list", "table") )
data |
A data frame input. Column types are used to infer the appropriate Microsoft Lists column definition. |
... |
Ignored. |
split |
character vector (or object which can be coerced to such)
containing regular expression(s) (unless |
ignore_na |
If |
definitions_as |
If |
Converting R data types to SharePoint column definitions
The type for each vector in the input data frame is checked with
vctrs::vec_ptype_abbr and mapped to corresponding SharePoint list column
definitions:
factors are specified as choice columns
integers are specified as number columns with decimals set to "none"
characters with any value exceeding 255 characters have multiple_lines set to TRUE
characters composed entirely of URL values are specified as hyperlink columns
dates are specified as date columns
dttm values are specified as datetime columns
logical values are specified as boolean columns if they include no NA values or text columns if they do
All other vectors are specified as text columns.
If the values of any input factor column contain the same character specified with split the choices will not be configured correctly.
data_as_column_definition_list(mtcars)data_as_column_definition_list(mtcars)
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.
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.
delete_sp_list_item( item_id = NULL, sp_list_item = NULL, ..., 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, ..., sp_list = NULL, filter = NULL, confirm = TRUE, .progress = TRUE )delete_sp_list_item( item_id = NULL, sp_list_item = NULL, ..., 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, ..., sp_list = NULL, filter = NULL, confirm = TRUE, .progress = TRUE )
item_id |
ID value for list item or items to delete. |
sp_list_item |
Optional. A SharePoint list item object to delete. |
... |
Additional parameters passed to |
list_name, list_id
|
SharePoint List name or ID string. |
sp_list |
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. |
site |
A |
confirm |
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. |
.progress |
Whether to show a progress bar. Use |
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.
keep_list_cols is intended to allow the preservation of list columns but it
is not yet supported.
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 ) }
get_sp_list_column() get a list column definition.
get_sp_list_column( sp_list = NULL, column_name = NULL, column_id = NULL, ..., list_name = NULL, list_id = NULL, column_name_type = "name" )get_sp_list_column( sp_list = NULL, column_name = NULL, column_id = NULL, ..., list_name = NULL, list_id = NULL, column_name_type = "name" )
sp_list |
A |
column_name, column_id
|
Column name or ID to get a definition for. |
... |
Arguments passed on to
|
list_name, list_id
|
SharePoint List name or ID string. |
column_name_type |
"name" or "displayName". Used to match column ID so
column_name must be unique if |
See Graph API documentation https://learn.microsoft.com/en-us/graph/api/columndefinition-get?view=graph-rest-1.0&tabs=http
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 = getOption("sharepointr.cache", FALSE), refresh = getOption("sharepointr.refresh", TRUE), overwrite = FALSE, cache_file = NULL, 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 = getOption("sharepointr.cache", FALSE), refresh = getOption("sharepointr.refresh", TRUE), overwrite = FALSE, cache_file = NULL, 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 or site. Default |
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", "external"), sync_fields = FALSE, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, as_data_frame = TRUE, 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", "external"), sync_fields = FALSE, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, as_data_frame = TRUE, 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", "external" (non-internal fields). Argument determines if the returned list metadata includes read only columns or hidden columns. |
sync_fields |
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, col_formatting = c("asis", "date"), display_nm = c("drop", "label", "replace"), select_type = c("asis", "editable", "external"), name_repair = "unique", pagesize = 5000, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() ) get_sp_list_items( list_name = NULL, list_id = NULL, sp_list = NULL, ..., filter = NULL, select = NULL, all_metadata = FALSE, as_data_frame = TRUE, col_formatting = c("asis", "date"), 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, col_formatting = c("asis", "date"), display_nm = c("drop", "label", "replace"), select_type = c("asis", "editable", "external"), name_repair = "unique", pagesize = 5000, site_url = NULL, site = NULL, drive_name = NULL, drive_id = NULL, drive = NULL, call = caller_env() ) get_sp_list_items( list_name = NULL, list_id = NULL, sp_list = NULL, ..., filter = NULL, select = NULL, all_metadata = FALSE, as_data_frame = TRUE, col_formatting = c("asis", "date"), 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 |
col_formatting |
"asis" (default) or "date". If "date", use the list column metadata and convert date columns to Date class and datetime columns to POSIXct class vectors (latter is not yet tested). |
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 |
select_type |
Type of columns to select. Ignored if |
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. Users seeking to access a
SharePoint subsite must provide the site_id instead of a site_url or
site_name value. You can see available subsite ID values by using the
list_subsites() method for Microsoft365R::ms_site objects.
get_sp_site( site_url = NULL, site_name = NULL, site_id = NULL, ..., cache = getOption("sharepointr.cache", FALSE), refresh = getOption("sharepointr.refresh", TRUE), overwrite = FALSE, cache_file = NULL, call = caller_env() ) cache_sp_site( ..., site = NULL, cache_file = NULL, cache_dir = NULL, overwrite = FALSE, call = caller_env() )get_sp_site( site_url = NULL, site_name = NULL, site_id = NULL, ..., cache = getOption("sharepointr.cache", FALSE), refresh = getOption("sharepointr.refresh", TRUE), overwrite = FALSE, cache_file = NULL, call = caller_env() ) cache_sp_site( ..., site = NULL, cache_file = NULL, cache_dir = NULL, 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 drive or site. Default |
call |
The execution environment of a currently
running function, e.g. |
site |
A |
cache_dir |
Cache directory. By default, uses an option
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. |