Skip to contents

[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

Examples

if (FALSE) { # \dontrun{
# 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))
} # }