sf_get_report_instance_results {salesforcer} | R Documentation |
Get report instance results
Description
Retrieves results for an instance of a report run asynchronously with or without filters. Depending on your asynchronous report run request, data can be at the summary level or include details.
Usage
sf_get_report_instance_results(
report_id,
report_instance_id,
labels = TRUE,
guess_types = TRUE,
bind_using_character_cols = deprecated(),
fact_map_key = "T!T",
verbose = FALSE
)
Arguments
report_id |
|
report_instance_id |
|
labels |
|
guess_types |
|
bind_using_character_cols |
|
fact_map_key |
|
verbose |
|
Value
tbl_df
; the detail report data. More specifically, the detailed
data from the "T!T" entry in the fact map.
Salesforce Documentation
Note
Below are the fact map key patterns for three report types:
- TABULAR
T!T
: The grand total of a report. Both record data values and the grand total are represented by this key.- SUMMARY
<First level row grouping_second level row grouping_third level row grouping>!T
: T refers to the row grand total.- MATRIX
<First level row grouping_second level row grouping>!<First level column grouping_second level column grouping>.
Each item in a row or column grouping is numbered starting with 0. Here are some examples of fact map keys:
- 0!T
The first item in the first-level grouping.
- 1!T
The second item in the first-level grouping.
- 0_0!T
The first item in the first-level grouping and the first item in the second-level grouping.
- 0_1!T
The first item in the first-level grouping and the second item in the second-level grouping.
See Also
Other Report Instance functions:
sf_delete_report_instance()
,
sf_list_report_instances()
Examples
## Not run:
# execute a report asynchronously in your Org
all_reports <- sf_query("SELECT Id, Name FROM Report")
this_report_id <- all_reports$Id[1]
results <- sf_execute_report(this_report_id, async=TRUE)
# check if that report has succeeded, ...
instance_list <- sf_list_report_instances(this_report_id)
instance_status <- instance_list[[which(instance_list$id == results$id), "status"]]
# ... if so, then grab the results
if(instance_status == "Success"){
report_data <- sf_get_report_instance_results(report_id = this_report_id,
report_instance_id = results$id)
}
## End(Not run)