[Experimental]

Creates a copy of a custom, standard, or public report by sending a POST request to the Report List resource.

sf_copy_report(report_id, name = NULL, verbose = FALSE)

Arguments

report_id

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

name

character; a user-specified name for the newly cloned report. If left NULL, then the new name will be the same name as the report being cloned appended with " = Copy" that is prefixed with a number if that name is not unique. It is highly recommended to provide a name, if possible.

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

list representing the newly cloned report with up to 4 properties that describe the report:

attributes

Report type along with the URL to retrieve common objects and joined metadata.

reportMetadata

Unique identifiers for groupings and summaries.

reportTypeMetadata

Fields in each section of a report type plus filter information for those fields.

reportExtendedMetadata

Additional information about summaries and groupings.

Salesforce Documentation

Examples

if (FALSE) {
# only the 200 most recently viewed reports
most_recent_reports <- sf_report_list()

# all possible reports in your Org
all_reports <- sf_query("SELECT Id, Name FROM Report")

# id of the report to copy
this_report_id <- all_reports$Id[1]

# not providing a name appends " - Copy" to the name of the report being cloned
report_details <- sf_copy_report(this_report_id)

# example of providing new name to the copied report
report_details <- sf_copy_report(this_report_id, "My New Copy of Report ABC")
}