Description Format Fields Methods Initialization List querying See Also Examples
Class representing a list in a SharePoint site.
An R6 object of class ms_sharepoint_list
, inheriting from ms_object
.
token
: The token used to authenticate with the Graph host.
tenant
: The Azure Active Directory tenant for the parent drive.
type
: always "list" for a SharePoint list object.
properties
: The item properties (metadata).
new(...)
: Initialize a new object. Do not call this directly; see 'Initialization' below.
delete(confirm=TRUE)
: Delete this item. By default, ask for confirmation first.
update(...)
: Update the item's properties in Microsoft Graph.
do_operation(...)
: Carry out an arbitrary operation on the item.
sync_fields()
: Synchronise the R object with the item metadata in Microsoft Graph.
list_items(filter, select, all_metadata, pagesize)
: Queries the list and returns items as a data frame. See 'List querying below'.
get_column_info()
: Return a data frame containing metadata on the columns (fields) in the list.
Creating new objects of this class should be done via the get_list
method of the ms_site class. Calling the new()
method for this class only constructs the R object; it does not call the Microsoft Graph API to retrieve or create the actual item.
list_items
supports the following arguments to customise results returned by the query.
filter
: A string giving a logical expression to filter the rows to return. Note that column names used in the expression must be prefixed with fields/
to distinguish them from item metadata.
select
: A string containing comma-separated column names to include in the returned data frame. If not supplied, includes all columns.
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
.
pagesize
: The number of results to return for each call to the REST endpoint. You can try reducing this argument below the default of 5000 if you are experiencing timeouts.
For more information, see Use query parameters at the Graph API reference. Due to current limitations in the Microsoft Graph REST API version 1.0, you can only read data from lists, not write to them.
sharepoint_site, ms_site
Microsoft Graph overview, SharePoint sites API reference
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
site <- sharepoint_site("https://mycompany.sharepoint.com/sites/my-site-name")
lst <- site$get_list("mylist")
lst$get_column_info()
lst$list_items()
lst$list_items(filter="startswith(fields/firstname, 'John')", select="firstname,lastname")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.