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.
Usage
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"),
col_select = 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()
)Arguments
- list_name, list_id
SharePoint List name or ID string.
- sp_list
A
ms_listobject. If supplied,list_name,list_id,site_url,site,drive_name,drive_id,drive, and any additional parameters passed to...are all ignored.- ...
Arguments passed on to
get_sp_listlist_name,list_idSharePoint List name or ID string.
metadataIf
TRUE,get_sp_list()applies theget_column_infomethod to the returned SharePoint list and returns a data frame with column metadata for the list.drive_name,drive_idSharePoint Drive name or ID passed to
get_drivemethod for SharePoint site object.
- 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
NULL, the data frame includes all columns from the list.- all_metadata
If
TRUE, the returned data frame will contain extended metadata as separate columns, while the data fields will be in a nested data frame named fields. This is always set toFALSEifn = NULLoras_data_frame = FALSE.- as_data_frame
If
TRUE, return a data frame with a "ms_list" column.get_sp_list()returns a 1 row data frame andlist_sp_lists()returns a data frame with n rows or all lists available for the SharePoint site or drive. Defaults toFALSE. Ignored ismetadata = TRUEas list metadata is always returned as a data frame.- 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
name_repairargument is required since there is no requirement on SharePoint for lists to use unique display names and invalid data frames can result.- col_select
Columns to select. Ignored if
selectis supplied. "asis" returns all available columns. "editable" returns ID and all non-read-only columns and "external" returns ID and all non-internal columns.- name_repair
Passed to repair argument of
vctrs::vec_as_names()- 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
ms_siteobject. Ifsiteis supplied,site_url,site_name, andsite_idare ignored.- drive_name, drive_id
SharePoint Drive name or ID passed to
get_drivemethod for SharePoint site object.- drive
A
ms_driveobject. Ifdriveis supplied,drive_nameanddrive_idare ignored.- call
The execution environment of a currently running function, e.g.
caller_env(). The function will be mentioned in error messages as the source of the error. See thecallargument ofabort()for more information.- id
Required. A SharePoint list item ID typically an integer for the record number starting from 1 with the first record.