sf_list_report_instances: List report instances

View source: R/analytics-report.R

sf_list_report_instancesR Documentation

List report instances

Description

[Experimental]

Returns a list of instances for a report that you requested to be run asynchronously. Each item in the list is treated as a separate instance of the report run with metadata in that snapshot of time.

Usage

sf_list_report_instances(report_id, as_tbl = TRUE, verbose = FALSE)

Arguments

report_id

character; the Salesforce Id assigned to a created analytics report. It will start with "00O".

as_tbl

logical; an indicator of whether to convert the parsed JSON into a tbl_df.

verbose

logical; an indicator of whether to print additional detail for each API call, which is useful for debugging. More specifically, when set to TRUE the URL, header, and body will be printed for each request, along with additional diagnostic information where available.

Value

tbl_df by default, or a list depending on the value of argument as_tbl

Salesforce Documentation

See Also

Other Report Instance functions: sf_delete_report_instance(), sf_get_report_instance_results()

Examples

## Not run: 
# first, get the Id of a report in your Org
all_reports <- sf_query("SELECT Id, Name FROM Report")
this_report_id <- all_reports$Id[1]

# second, execute an async report
results <- sf_execute_report(this_report_id, async=TRUE)

# third, pull a list of async requests ("instances") usually meant for checking 
# if a recently requested report has succeeded and the results can be retrieved
instance_list <- sf_list_report_instances(this_report_id)
instance_status <- instance_list[[which(instance_list$id == results$id), "status"]]

## End(Not run)

salesforcer documentation built on March 18, 2022, 6:26 p.m.