Changelog
Source:NEWS.md
sharepointr (development version)
Added
-
sp_dir_ls()gainsrecurseand.batcharguments (likefs::dir_ls()),full_namesdefaults torecurse, andtypenow works withinfo = "name".sp_dir_info(recurse = TRUE, full_names = FALSE)now warns since names are relative to each directory. When more than onepathis supplied,sortis applied to the combined result, and strings are sorted in the C locale whatever the user’s locale. (2026-10-26) - Add a
.batchargument tosp_dir_info(). By default (.batch = TRUE),sp_dir_info(recurse = TRUE)now requests up to 20 directories at a time with Microsoft Graph$batchrequests, which was about 11 times faster than a request per directory when listing a folder with 6,595 items (10 seconds instead of 110). Throttled requests are retried after the delay requested by the API. If carrier and mirai are installed andmirai::daemons()are set, the$batchrequests for each level are also sent in parallel (about 1.4 to 1.8 times faster with 4 daemons in testing). Use.batch = FALSEoroptions(sharepointr.batch = FALSE)to send a request per directory. (2026-10-21) -
sp_dir_info(recurse = TRUE)now lists directories level by level and shows a single progress bar (directories listed and queued) instead of a bar that reset for each directory.regexpandtypeare now applied after all directories are listed (as infs::dir_info()), so non-matching directories are still searched andtype = "file"works withrecurse = TRUE. A newsortargument sorts results by name, size, created time, or modified time (e.g."name-asc", the default for recursive results). Also fixes subdirectory paths whenfull_names = FALSE. (2026-10-21) -
sp_dir_info()andsp_dir_ls()now request the children of a folder directly from the Graph API instead of using the Microsoft365Rlist_itemsmethod. Add aselectargument tosp_dir_info()to request additional driveItem properties (e.g."webUrl") withoutinfo = "all", and the properties needed bysort(such as created or modified time) are now requested automatically. Item names in the drive root no longer have a leading slash whenfull_names = TRUE, and path segments with reserved characters such as#are now encoded. (2026-10-21) - Add
update_sp_item_properties()(experimental) to rename a file or folder or update the values of document library columns for an item. Field values are updated withupdate_sp_list_item(), so the same field name checks and formatting are used. (2026-10-14) - Add a
fieldsargument toget_sp_item_properties()andupdate_sp_item_properties(). Iffields = TRUE, the document library column values for the item are added as afieldselement (a named list) or, ifas_data_frame = TRUE, afieldslist column with a 1 row data frame. (2026-10-14) - Add
sp_item_copy(),sp_item_move(),sp_dir_copy(), andsp_dir_move()(experimental) to copy and move SharePoint files and folders. The interface is based onfs::file_copy(),fs::file_move(), andfs::dir_copy(): ifnew_pathis an existing folder, items are placed inside it.new_pathcan also be a SharePoint folder or library URL, and items can be copied (but not moved) to another drive or site. Setoverwrite = TRUEto replace an existing item. By default, the copy functions wait for each copy to finish (wait = TRUE) so that a failed copy is reported. (2026-10-14) -
download_sp_item()(with multiple items) andupload_sp_items()now download or upload items in parallel if carrier and mirai are installed andmirai::daemons()are set. Folders are always uploaded one at a time. For batch downloads, the drive is now looked up once instead of for each item (unless items are SharePoint URLs).upload_sp_items()now checks that everyfileorsrcexists before uploading any files. (2026-10-13) - Add a
.batchargument tocreate_sp_list_items(),update_sp_list_items(), anddelete_sp_list_items(). By default, items are now sent with Microsoft Graph$batchrequests (up to 20 items per request), which was 7 to 9 times faster than a request per item in testing (and 10 to 15 times faster withmirai::daemons()set). Throttled requests are retried after the delay requested by the API. If any items fail, the other items are still sent and the error lists the failed items. Use.batch = FALSEoroptions(sharepointr.batch = FALSE)to send a request per item. Items created in a$batchrequest may not get IDs in the same order as the input data (use.batch = FALSEif the order of IDs matters). (2026-10-10) - Add
upload_sp_items()function (2024-06-24). - Add vignette for reading and writing items from SharePoint (#9; 2024-07-25).
- Add
update_sp_list_items()function and refactorupdate_sp_list_item()to userlang::list2()andrlang::inject()which adds support for data frame inputs. (2024-08-10) - Add
display_nmargument tolist_sp_list_items()allowing use of list display names as labels or replacements for field names in results. (2024-08-10) - Add
download_sp_list()(2024-10-10). - Add
create_column_definition()and related functions for creating lists equivalent to columnDefinition objects. (2025-05-02) - Add
update_sp_list()for limited updates to Microsoft List metadata. (2025-07-24) - Add purrr to imports to incorporate new
purrr::in_parallel()function. Requires users have carrier and mirai installed and set workers usingmirai::daemons(). (2025-07-25) - Add support for reading list items with
read_sharepoint(). (2025-08-26) - Add
delete_sp_list_item()anddelete_sp_list_items(). (2025-08-26) - Add
copy_column_definition_list()(2026-03-13) - Add
update_sp_list_lookup_items(). (2026-05-28) - Add the
order_byandorder_dirarguments tolist_sp_list_items(). (2026-06-05) - Add support for
ms_drive_iteminputs fordestargument ofupload_sp_item()andupload_sp_items(). (2026-06-12) - Add
pull_sp_list_cols()(internal) to get a named index of list columns fromget_sp_list_metadata()output matching a column type (e.g. “lookup” or “choice”), a column property (e.g. “required” or “hidden”), or akeepvalue (“all”, “editable”, or “external”). Supports both data frame and list metadata;get_sp_list_metadata()now uses it to filter columns. (2026-09-24) - Add support for updating list fields with multi-choice (checkbox) values —
update_sp_list_item()/create_sp_list_item()now append @odata.type Collection hints so the Graph API accepts multi-value fields. - Allow
delete_sp_list_item()/delete_sp_list_items()to accept a data frame foritem_id(uses its id column). - Allow
update_sp_list_items()to accept an unnamed list of named lists (one record per item, each with an.idelement) as well as a data frame. Fields missing from a record are left unchanged. (2026-10-01) - Allow
delete_sp_list_items()to accept an unnamed list of named lists (one record per item) foritem_id. Add a.idargument todelete_sp_list_item()anddelete_sp_list_items()to set the id column or element name. (2026-10-01) - Allow
create_sp_list_items()to accept a list of named lists (one record per item) as well as a data frame.create_sp_list_items(),update_sp_list_items(),delete_sp_list_items(),update_sp_list_lookup_items(), andfmt_sp_list_lookup_items()now accept the same list inputs (a single record, where supported, or a named or unnamed list of records) with the same error message. (2026-10-10) - Add a
strictargument toupdate_sp_list_items()(matchingcreate_sp_list_items()) to error if any column or record field name doesn’t match a list field. (2026-10-10) - Add
update_sp_list_person_items()for updating person or group columns (matched by email address using the site “User Information List”) andfmt_sp_list_lookup_items()for formatting lookup or person columns as “{column_name}LookupId” values. These replacesp_user_id_as_lookup_id()andfmt_person_lookup_id_values(). (2026-10-01) - Add
create_sp_list_person_column()(experimental) for creating person or group columns. (2026-10-01) - Export
create_sp_list_lookup_column(),update_sp_list_lookup_items(),update_sp_list_person_items(),fmt_sp_list_lookup_items(), andlist_sp_site_user_info()as experimental functions (no longer internal).create_sp_list_lookup_column()and the update functions now use a consistent argument order (datafirst for update functions andsp_listfirst for create functions),lookup_listcan be ams_listobject, list name, or list URL (and must be in the same site assp_list), and thesp_lookup_listargument is removed.update_sp_list_lookup_items()andfmt_sp_list_lookup_items()accept a data frame or list of records, support a different join column name for the lookup list (lookup_join_column) and case-insensitive matching (ignore_case), and list any values that can’t be matched. (2026-10-01) - Add
user_typeandfilterarguments tolist_sp_site_user_info(). Useuser_type = "visible"to exclude hidden users. (2026-10-01) - Add a YAML format for SharePoint list definitions that uses Microsoft Graph list and columnDefinition property names (
displayName,description,listfor listInfo settings liketemplate, andcolumns), withcustommetadata (at the list or column level) passed through without validation. Read-only list properties (e.g.id,webUrl,createdDateTime, andparentReference) and column ids can be included as a reference to an existing list; they are never sent to SharePoint.get_sp_list_definition()andwrite_sp_list_yaml()include the stable read-only properties and column ids by default (read_only = "stable"). Addread_sp_list_yaml(),write_sp_list_yaml(),get_sp_list_definition(),as_sp_list_definition(), andsp_list_definition_table()(also used by anas.data.frame()method) as experimental functions.write_sp_list_yaml()keeps the comment header, column order, andcustommetadata from an existing file (custommetadata in a definition passed towrite_sp_list_yaml()takes precedence). A definition with no columns (e.g. a list with only the default Title column) is written ascolumns: []. An optional document start marker (---) can end the comment header, andwrite_sp_list_yaml(doc_start = )controls whether one is written (by default, only if the existing file has one).read_sp_list_yaml()errors on a file with more than one YAML document. Requires yaml12 (added to Suggests). (2026-10-09) - Add
compare_sp_list()andsync_sp_list()(experimental) to compare column definitions with an existing list and apply the changes. Only changed properties are sent. Changes the Graph API can’t make (switching between single and multiple lines of text or single and multiple choice, and column validation) use the SharePoint REST API. Changes that may cause data loss are skipped unlessallow_data_loss = TRUE, and changes that can’t be made (e.g. changing the column type) are reported as blocked. (2026-10-09) - Add
list_sp_list_views(),get_sp_list_view(),create_sp_list_view(),update_sp_list_view(), anddelete_sp_list_view()(experimental) for SharePoint list views. The Graph API doesn’t support views, so these functions use the SharePoint REST API (with a delegated login) and the SP.View property names (e.g.ViewFields,ViewQuery,RowLimit).update_sp_list_view()only changes properties that differ from the existing view, and the default view can’t be deleted. Add jsonlite to Imports for view formatting (custom_formatter). (2026-10-09) - List definitions support an optional
viewskey with SP.View properties.create_sp_list(definition = )creates the views (a view titled “All Items” updates the default view), andget_sp_list_definition()andwrite_sp_list_yaml()include views ifinclude_views = TRUE(defaultFALSE). View formatting is written as a YAML mapping. (2026-10-09) - Add
as_column_definition()to validate a column definition using Graph property names andcolumn_validation()to create a column validation definition. (2026-10-09) -
create_column_definition()and thecreate_*_column()helpers now accept Graph property names passed to...(e.g.allowMultipleLines = TRUE) and validate all properties. Unknown properties are now an error instead of being added to the definition. (2026-10-09) - Add a
definitionargument tocreate_sp_list()to create a list (name, description, template and other listInfo settings, and columns) from a definition or YAML file. ATitlecolumn updates the default title column, calculated columns are added after the list is created, and column validation is applied with the SharePoint REST API.list_nameis now optional whendefinitionis supplied.create_sp_list_column()also accepts definitions fromread_sp_list_yaml(). (2026-10-09) -
compare_sp_list()andsync_sp_list()compare and update list views if a definition has aviewselement (or skip them withviews = FALSE). Views are matched byIdorTitle, the default view is set after other changes, and the current default view can’t be deleted unless another view becomes the default. The results have anobjectcolumn ("list","column", or"view") and anidcolumn (replacingcolumn_id). (2026-10-09) -
compare_sp_list()andsync_sp_list()use a definitionidandparentReference.siteIdto get the list ifsp_listisn’t supplied, and error if the listiddoesn’t match the definition. They also compare and update the listdisplayName,description,hidden, andcontentTypesEnabledsettings. Formulas are compared after normalizing the changes SharePoint makes when saving a formula. (2026-10-09) -
create_sp_list()andcreate_sp_list_column()error if a new list column’s name is longer than 32 characters (counting each space or special character as 7, e.g._x0020_), since SharePoint cuts it without an error (document libraries allow longer names), and warn if a display name is longer than 255 characters (the limit on the column settings page; the Graph API accepts longer ones).compare_sp_list()reports adding a column with a long name as"blocked", sosync_sp_list()skips it. (2026-10-09) - Add
create_sp_drive()(experimental) to create a document library and return its drive as ams_driveobject. It wrapscreate_sp_list(template = "documentLibrary")and accepts the same list definitions, plus afoldersargument. It doesn’t create SharePoint Embedded containers (GraphfileStorageContainer), which need an app that owns a registered container type. (2026-10-13) - Add
update_sp_drive()anddelete_sp_drive()(experimental) to change the display name or description of a document library or delete it. Renaming a library changes the drive name but not the library URL.delete_sp_drive()asks for confirmation by default and won’t delete the site’s default document library. - List definitions for a document library support an optional
folderskey: a sequence of folder paths relative to the library root (parent folders are created as needed).create_sp_list()andcreate_sp_drive()create the folders,compare_sp_list()andsync_sp_list()add missing folders (never deleting any; skip them withfolders = FALSE), andget_sp_list_definition()andwrite_sp_list_yaml()include folders ifinclude_folders = TRUE(defaultFALSE). (2026-10-13) - List definitions work better for document libraries: the built-in library columns (e.g.
FileLeafRefand_ExtendedDescription) are left out ofget_sp_list_definition()and only compared bycompare_sp_list()if a definition includes them, aTitlecolumn updates the default title column of a new library, a view titled “All Documents” updates the default view of a new library, and library fields (e.g.LinkFilename) can be shown in a view without a warning. (2026-10-13)
Fixes
Fix
write_sharepoint()saving officerrxlsxobjects withreadr::write_rds()and only matching a lowercase “.xlsx” extension for data frames (e.g."data.XLSX"was written as a CSV file). (2026-10-10)Fix
update_sp_list_items()copying the calling environment (and any objects in it) to every parallel worker whenmirai::daemons()are set. (2026-10-13)Fix
download_sp_item()erroring for a list of items with nodest(each item is now downloaded using the item name). (2026-10-13)Fix
create_sp_list_items(),update_sp_list_items(), anddelete_sp_list_items()requiring carrier and mirai (and erroring or prompting to install them) even when items aren’t sent in parallel. Items are now only sent in parallel withpurrr::in_parallel()if both packages are installed andmirai::daemons()are set; otherwise, items are sent sequentially. carrier and mirai are now listed in Suggests and purrr 1.2.0 or later is now required. (2026-10-13)Fix
delete_sp_list_items(),create_sp_list_items(), andupdate_sp_list_items()failing for items with a temporary “Database is read only” error from SharePoint when sending many items with$batchrequests. These requests, and requests with a 504 status, are now retried along with throttled requests (status 429 or 503). Requests without aRetry-Afterheader are retried after an increasing delay (2, 4, 8, … seconds, up to 60 seconds) and up to 5 times (instead of 3). The error for failed items now includes the HTTP status and Graph error code. (2026-10-13)Fix
Datevalues written to list date columns (e.g. withcreate_sp_list_item()orupdate_sp_list_items()) being stored as the previous day on SharePoint sites with a time zone west of UTC.Datevalues were sent as midnight UTC (e.g."2026-10-13T00:00:00Z") and are now sent as a date with no time or offset (e.g."2026-10-13"), which SharePoint stores using the site’s time zone.POSIXctvalues are still sent as UTC date-times. (2026-10-13)Fix
sp_url_parse()decoding URL paths twice with httr2 1.1.0 or later, which changed file, folder, list, or library names that include a%character (e.g."100%.xlsx").sp_url_parse_path()now expects a decoded path (as returned byhttr2::url_parse()). Requires httr2 1.1.0 or later. (2026-10-10)Fix
sp_url_parse()(and functions that accept a SharePoint URL) for list URLs with no view page (e.g."https://contoso.sharepoint.com/sites/site-name/Lists/list-name"). (2026-10-10)sp_url_parse()now errors if a site name can’t be found in a URL, instead of returning a site URL with no site name that caused a “not found” error from the Graph API. (2026-10-10)Fix
compare_sp_list()andsync_sp_list()reporting alocalechange for a column that was just created from the same definition (SharePoint returns locales like"en-US"for"en-us"). Locales are now compared ignoring case. (2026-10-10)Fix item id handling for
update_sp_list_items(),delete_sp_list_item(), anddelete_sp_list_items(): item ids from a data frame, list of records, or vector are now checked (as whole numbers or non-empty strings) before any items are changed, so a missing or invalid id no longer stops a batch partway through. Item ids are sent as strings.delete_sp_list_item()errors for more than one item id or for unused arguments, anddelete_sp_list_items()errors if bothitem_idandfilterare supplied. (2026-10-10)Fix
update_sp_list_item()sending an empty update when only the.idfield is left after droppingNAvalues (with.idother than"id") and erroring when no fields are supplied. (2026-10-10)Fix
create_sp_list_items()returning modifieddata(and bothcreate_sp_list_items()andupdate_sp_list_items()returning emptydatavisibly): the input is now always returned invisibly and unmodified.create_sp_list_items()also checksdatabefore any API calls or creating a list. (2026-10-10)Fix
update_sp_list_column()sending the whole column definition: only properties that differ from the existing column are sent. (2026-10-09)Fix
create_number_column()rejecting decimalmaxandminvalues. (2026-10-09)Fix
update_sp_list_items()anddelete_sp_list_items()handling of named lists: a single named list record (with an.idelement) or a named list of records is now supported. Previously,update_sp_list_items()only sent the first field from a named list, anddelete_sp_list_items()used every element of a named list as an item id. Other named lists now error. (2026-10-06)Fix
list_sp_list_items()returning no items for a filtered query on a list with more than 5,000 items when the first page of results is empty. The Graph API evaluates these queries in batches, and an empty first page caused all later items to be dropped. (2026-10-05)Fix updates to multi-value lookup and person or group columns:
"{name}LookupId"values are now sent as aCollection(Edm.Int32)(lookup ID values are often returned as strings). (2026-10-01)Fix
delete_sp_list_item()erroring with a data frameitem_id(the id value is now pulled from the data frame before checking arguments and getting the list item). (2026-10-01)Fix
update_sp_list_items()validating fields again for every item: fields are now validated once per call, socheck_fields = FALSEis respected, and list column metadata is requested once per call (and shared for field validation and identifying multi-value fields) instead of for each item.create_sp_list_items()also shares a single list column metadata request for field validation and identifying multi-value fields. (2026-10-01)Fix multi-select (multi-value) fields when creating or updating list items from a data frame with list-columns:
create_sp_list_items()/update_sp_list_items()now unwrap list-column values, use list column definitions to send single or empty selections for multi-value columns as a Collection, and convertsfccolumns to WKT for updates as well as creates.na_fields = "drop"now also drops empty values (e.g.character(0)) so existing values are left in place. (2026-10-01)Fix bug where
get_sp_list_item()only returned item ID, not theMicrosoft365R::ms_list_itemobject (2024-08-10)Fix bug where
read_sharepoint()usedreadr::read_lines()for PowerPoint files. (2024-10-10)Fix
upload_sp_item()overwrite check validating against the source filename instead of the actual destination filename when dest renames the file.Fix
sp_dir_info()erroring (instead of warning) whenrecurse = TRUEandtype = "file"are both supplied.Fix
sp_url_parse_path()erroring on drive names containing regex metacharacters (e.g. parentheses) by matching the drive name as a fixed string instead of interpolating it unescaped into a regex.Fix
list_sp_tasks()/get_sp_task()erroring when combining Planner tasks whose properties (e.g.dueDateTime,appliedCategories) are missing for some tasks but present for others, by no longer forcing a placeholder type for missing properties and by keeping dictionary-typed properties (assignments,appliedCategories) as consistent list columns. Also fixes a related crash inlist_sp_group_members()for group members entirely missing an expected property.
Changes
-
get_sp_item(),get_sp_item_properties(),sp_dir_info()(andsp_dir_ls()), andupload_sp_item()(andwrite_sharepoint()) now use the Microsoft Graph shares API to get a file or folder from a SharePoint URL (a “Copy link” link, document URL, item URL, or document library URL). This supports items in any document library, links to items that have been moved, and URLs that can’t be parsed (e.g. thewebUrlfor a file or a document library URL for a folder with anidquery parameter). If the shares API request fails, the site, drive, and path are parsed from the URL as before.sp_dir_info()andupload_sp_item()now error if a URL is for a file instead of a folder, andupload_sp_item()no longer errors ifdestisNULLandoverwrite = FALSE.upload_sp_items()now supports a vector of destination URLs (including folders in different drives), finds the drive for a URLdestifdriveisn’t supplied, and gainsoverwrite,drive_name,drive_id, anddrivearguments. Likeupload_sp_item(), it now errors if a file already exists unlessoverwrite = TRUE. (2026-10-10) -
write_sharepoint()now errors iffileis a shapefile (which writes more than one file, so only the “.shp” file was uploaded), anddestdefaults toNULL(the top level of the drive) to matchupload_sp_item(). (2026-10-10) - Remove the
sync_fieldsargument ofget_sp_list_metadata()andcreate_sp_list_items().get_sp_list_metadata()always requests the column definitions from the API so syncing the local list object did not change the result. (2026-10-20) -
get_sp_list_metadata()has a new"visible"option forkeep(the new default), which returns the columns the Graph API returns by default (without hidden columns).keep = "all"now includes hidden columns. Use the newselectargument to limit the column properties returned. (2026-10-20) - Soft deprecate the
metadataargument ofget_sp_list(). Useget_sp_list_metadata()instead, which returns the same columns asmetadata = TRUE. (2026-10-20) -
list_sp_list_items()no longer includes the"@odata.etag"column, which the Graph API returns with the fields of each item, unlessall_metadata = TRUE. (2026-10-10) - Revise
read_sharepoint()to support zipped shapefiles. (2024-07-25) - Improve printing of custom
.fargument inread_sharepoint(). (2024-10-10) - Alert users if input
datais empty forcreate_sp_list_items(),update_sp_list_items()and error if inputitem_idis length 0 fordelete_sp_list_items(). (2026-01-06) - Improve handling of
sfdata inputs forcreate_sp_list_items()(2026-05-27). - Add httr and AzureGraph to Imports to re-implement an internal version of the
list_itemsmethod forMicrosoft365R::ms_listobjects. (2026-06-05) - Add dplyr and tidyselect to Suggests in support of the
update_sp_list_lookup_items()function. (2026-09-04) - Remove dplyr and tidyselect from Suggests by using vctrs to match items in
update_sp_list_lookup_items(). (2026-10-01) - The
create_*_column()helpers no longer send default values for properties that aren’t supplied, so SharePoint uses its own defaults. This changes the defaults forhidden(wasFALSE),text_type(was"plain"),allow_text(wasTRUE; SharePoint defaults toFALSE),display_asfor choice (was"dropDownMenu") and date columns (was"default"),decimal_places(was"automatic"),formatfor date columns (was"dateOnly";create_column_definition_list()still uses"dateOnly"for a"date"type),locale(was"en-us"), andallow_multiple_valuesfor term columns (wasTRUE). (2026-10-09) - Deprecate arguments to align with Graph property names:
displayname(usedisplay_name),decimals(usedecimal_places), andallow_multiple(useallow_multiple_valuesfor lookup and term columns orallow_multiple_selectionfor person or group columns). (2026-10-09) -
create_calculated_column()errors ifformatis supplied whenoutput_typeisn’t"dateTime"(previously ignored) and returns the formula as a string. (2026-10-09) - Document that the Graph API can’t create hyperlink, picture, thumbnail, geolocation, or term columns on a list. (2026-10-09)