Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extract_list_values

Get the list of values from a Graph pager object


Description

Get the list of values from a Graph pager object

Usage

extract_list_values(pager, n = Inf)

Arguments

pager

An object of class ms_graph_pager, which is an iterator for a list of paged query results.

n

The number of items from the list to return. Note this is not the number of pages (each page will usually contain multiple items). The default value of Inf extracts all the values from the list, leaving the pager empty. If this is NULL, the pager itself is returned.

Details

This is a convenience function to perform the common task of extracting all or some of the items from a paged response.

Value

If n is Inf or a number, the items from the paged query results. The format of the returned value depends on the pager settings. This will either be a nested list containing the properties for each of the items; a list of R6 objects; or a data frame. If the pager is empty, an error is thrown.

If n is NULL, the pager itself is returned.

See Also

Examples

## Not run: 

firstpage <- call_graph_endpoint(token, "me/memberOf")
pager <- ms_graph_pager$new(token, firstpage)
extract_list_values(pager)

# trying to extract values a 2nd time will fail
try(extract_list_values(pager))


## End(Not run)

AzureGraph

Simple Interface to 'Microsoft Graph'

v1.3.0
MIT + file LICENSE
Authors
Hong Ooi [aut, cre], Microsoft [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.