sf_list_report_fields: Get a list of report fields

View source: R/analytics-report.R

sf_list_report_fieldsR Documentation

Get a list of report fields

Description

[Experimental]

The Report Fields resource returns report fields available for specified reports. Use the resource to determine the best fields for use in dashboard filters by seeing which fields different source reports have in common. Available in API version 40.0 and later.

Usage

sf_list_report_fields(
  report_id,
  intersect_with = c(character(0)),
  verbose = FALSE
)

Arguments

report_id

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

intersect_with

character a vector of unique report IDs. This is helpful in determining the best fields for use in dashboard filters by seeing which fields different source reports have in common. If this argument is left empty, then the function returns a list of all possible report fields. Otherwise, returns a list of fields that specified reports share.

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 4 different field report properties:

displayGroups

Fields available when adding a filter.

equivalentFields

Fields available for each specified report. Each object in this array is a list of common fields categorized by report type.

equivalentFieldIndices

Map of each field’s API name to the index of the field in the equivalentFields array.

mergedGroups

Merged fields.

Salesforce Documentation

See Also

Other Report functions: sf_copy_report(), sf_create_report(), sf_delete_report(), sf_describe_report_type(), sf_describe_report(), sf_execute_report(), sf_list_report_filter_operators(), sf_list_report_types(), sf_list_reports(), sf_query_report(), sf_run_report(), sf_update_report()

Examples

## Not run: 
# 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 check fields on
this_report_id <- all_reports$Id[1]

# third, pull that report and intersect its fields with up to three other reports
fields <- sf_list_report_fields(this_report_id, intersect_with=head(all_reports[["Id"]],3))

## End(Not run)

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