Get the list of values from a Graph pager object
Get the list of values from a Graph pager object
extract_list_values(pager, n = Inf)
pager |
An object of class |
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 |
This is a convenience function to perform the common task of extracting all or some of the items from a paged response.
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.
## 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.