View source: R/analytics-report.R
sf_create_report | R Documentation |
Create a new report using a POST request. To create a report, you only have to
specify a name and report type to create a new report; all other metadata properties
are optional. It is recommended to use the metadata from existing reports pulled
using sf_describe_report
as a guide on how to specify the properties
of a new report.
sf_create_report( name = NULL, report_type = NULL, report_metadata = NULL, verbose = FALSE )
name |
|
report_type |
|
report_metadata |
|
verbose |
|
list
representing the newly cloned report with up to 4 properties
that describe the report:
Report type along with the URL to retrieve common objects and joined metadata.
Unique identifiers for groupings and summaries.
Fields in each section of a report type plus filter information for those fields.
Additional information about summaries and groupings.
Other Report functions:
sf_copy_report()
,
sf_delete_report()
,
sf_describe_report_type()
,
sf_describe_report()
,
sf_execute_report()
,
sf_list_report_fields()
,
sf_list_report_filter_operators()
,
sf_list_report_types()
,
sf_list_reports()
,
sf_query_report()
,
sf_run_report()
,
sf_update_report()
## Not run: # creating a blank report using just the name and type my_new_report <- sf_create_report("Top Accounts Report", "AccountList") # creating a report with additional metadata by grabbing an existing report # and modifying it slightly (only the name in this case) # first, grab all possible reports in your Org all_reports <- sf_query("SELECT Id, Name FROM Report") # second, get the id of the report to copy this_report_id <- all_reports$Id[1] # third, pull down its metadata and update the name report_describe_list <- sf_describe_report(this_report_id) report_describe_list$reportMetadata$name <- "TEST API Report Creation" # fourth, create the report by passing the metadata my_new_report <- sf_create_report(report_metadata=report_describe_list) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.