Execute Sync

Runs a report immediately with or without changing filters, groupings, or aggregates and returns the latest summary data with or without details for your level of access.

Resource URL 

1/services/data/<latest API version>/analytics/reports/<report ID>

Formats 

JSON

HTTP Methods 

MethodDescription
GETGet report results. See this example.
POSTGet specific results by passing dynamic filters, groupings, and aggregates in the report metadata. See this example.

POST Request Body 

PropertyTypeDescription
aggregatesArray of stringsUnique identities for summary or custom summary formula fields in the report.
allowedInCustomDetailFormulaBooleanSpecifies whether a field can be referenced in a row-level formula (true) or not (false).
bucketsBucket fieldDescribes a bucket field.
chartChart[]Details about the chart used in a report.
crossFiltersCross filter[]Cross filters applied to the report.
customDetailFormulaCustom Detail Formula[]An array of objects that describes row-level formulas.
customSummaryFormulaCustom summary formulaDescribes a custom summary formulas.
currencyStringReport currency, such as USD, EUR, GBP, for an organization that has Multi-Currency enabled. Value is null if the organization does not have Multi-Currency enabled.
dashboardSettingName/value pairAllows saving of dashboard settings to allow for reports with row limit filters on dashboards. Can be configured on a report for Top-N reports. The Name and Value fields in dashboardSetting are used as Grouping and Aggregate in dashboard components.
detailColumnsArray of stringsUnique API names for the fields that have detailed data.
developerNameStringReport API name.
divisionStringDetermines the division of records to include in the report. For example, West Coast and East Coast. Available only if your organization uses divisions to segment data and you have the “Affected by Divisions” permission. If you do not have the “Affected by Divisions” permission, your reports include records in all divisions.
folderIdStringID of the folder that contains the report. When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public Reports folder, folderId = orgId.
groupingsAcrossGroupings across[]Unique identities for each column grouping in a report. The identity is an empty array for reports in summary format as it can’t have column groupings, BucketField_(ID) for bucket fields, or the ID of a custom field when the custom field is used for a column grouping.
groupingsDownGroupings down[]Unique identities for each row grouping in a report. The identity is BucketField_(ID) for bucket fields, or the ID of a custom field when the custom field is used for grouping.
hasDetailRowsBooleanIndicates whether to include detailed data with the summary data.
hasRecordCountBooleanIndicates whether the report shows the record count.
historicalSnapshotDatesArray of stringsList of historical snapshot dates.
idStringUnique report ID.
nameStringDisplay name of the report.
presentationOptionsReport presentation optionsDisplay options in the Lightning Report Builder.
reportBooleanFilterStringLogic to parse custom field filters. Value is null when filter logic is not specified.
reportFiltersFilter details[]List of each custom filter in the report along with the field name, filter operator, and filter value.
reportFormatStringFormat of the report. Possible values are TABULAR, SUMMARY, MATRIX, or MULTI_BLOCK. The MULTI_BLOCK property is available in API version 43.0 and later.
reportTypeReport typeUnique API name and display name for the report type. type (string) is the unique identifier of the report type. label (string) is the display name of the report type.
scopeStringDefines the scope of the data on which you run the report. For example, you can run the report against all opportunities, opportunities you own, or opportunities your team owns. Valid values depend on the report type.
showGrandTotalBooleanIndicates whether the report shows the grand total.
showSubtotalsBooleanIndicates whether the report shows subtotals, such as column or row totals.
sortByArray of stringsAPI name of the field on which the report is sorted and the direction of the sort (asc or desc).
standardDateFilterArray of stringsStandard date filters available in reports. Each standard date filter contains the following properties: column (API name of the date field on which you filter the report data), durationValue (the range for which you want to run the report; the value is a date literal or ‘CUSTOM.’), startDate (start date), and endDate (end date).
standardFiltersArray of stringsList of filters that show up in the report by default. The filters vary by report type. For example, standard filters for reports on the Opportunity object are Show, Opportunity Status, and Probability. This list appears as name-value string pairs.
supportsRoleHierarchyBooleanIndicates whether the report type supports role hierarchy filtering (true) or not (false).
topRowsTop rowsDescribes a row limit filter applied to the report.
userOrHierarchyFilterIdStringUnique user or role ID of the user or role used by the report’s role hierarchy filter. If specified, a role hierarchy filter is applied to the report. If unspecified, no role hierarchy filter is applied to the report.

Example aggregates identities:

  • a!Amount represents the average for the Amount column.
  • s!Amount represents the sum of the Amount column.
  • m!Amount represents the minimum value of the Amount column.
  • x!Amount represents the maximum value of the Amount column.
  • s!<customfieldID> represents the sum of a custom field column. For custom fields and custom report types, the identity is a combination of the summary type and the field ID.
  • u!{column_name} represents a unique count of values for the specified {column_name}. For example, u!_AccountName_ returns the number of unique account name values in the AccountName field.

Example reportBooleanFilter. This is an example of a report filtered to show opportunities for accounts that are either of customer or partner type OR their annual revenue exceeds 100K AND they are medium or large sized businesses. The filters are processed by the logic, “(1 OR 2) AND 3.”

1{
2...
3        "reportBooleanFilter": "(1 OR 2) AND 3",
4        "reportFilters": [
5            {
6                "value": "Analyst,Integrator,Press,Other",
7                "column": "TYPE",
8                "operator": "notEqual"
9            },
10            {
11                "value": "100,000",
12                "column": "SALES",
13                "operator": "greaterThan"
14            },
15            {
16                "value": "Small",
17                "column": "Size",
18                "operator": "notEqual"
19            }
20        ]
21    }
22}

Example sortBy:

1"sortBy":[{"sortColumn":"Account_ID","sortOrder":"asc"}]

Response Body 

PropertyTypeDescription
allDataBooleanWhen True, all report results are returned. When False, results are returned for the same number of rows as a report run in Salesforce. For reports that have too many records, use filters to refine results.
attributesAttributesKey report attributes and child resource URLs.
factMapFact mapSummary level data or both summary and detailed data for each row or column grouping. Detailed data is available if hasDetailRows is true. Each row or column grouping is represented by combination of row and column grouping keys defined in Groupings down and Groupings across. See these examples of fact map keys.
groupingsAcrossGroupings acrossCollection of column groupings, keys, and their values.
groupingsDownGroupings downCollection of row groupings, keys, and their values.
hasDetailRowsBooleanWhen true, the fact map returns values for both summary level and record level data. When false, the fact map returns summary values.
hasExceededTabularRowLimitBooleanWhen True, returns results for the same number of rows as a report run in Salesforce. For a report on Salesforce Objects, total and subtotal rows don’t count toward this limit. For a report on Data 360 Objects, total and subtotal rows do count toward this limit. When False, all report results are returned.
reportExtendedMetadataReport extended metadataAdditional information about columns, summaries, and groupings.
reportMetadataReport metadataUnique identifiers for groupings and summaries.

Attributes

PropertyTypeDescription
describeUrlStringResource URL to get report metadata.
instancesUrlStringResource URL to run a report asynchronously. The report can be run with or without filters to get summary or both summary and detailed data. Results of each instance of the report run are stored under this URL.
typeStringAPI resource format.
reportNameStringDisplay name of the report.
reportIdStringUnique report ID.

Fact map

PropertyTypeDescription
rowsData cells[]Array of detailed report data listed in the order of the detail columns provided by the report metadata.
aggregatesAggregates[]Summary level data including record count for a report.

Data cells

PropertyTypeDescription
valueDetail column info data typeThe value of a specified cell. If the response is an empty string, then API version 36.0 and earlier returns null. API version 37.0 and later returns an empty string.
labelStringDisplay name of the value as it appears for a specified cell in the report.

Aggregates

PropertyTypeDescription
valueNumberNumeric value of the summary data for a specified cell.
labelStringFormatted summary data for a specified cell.

Groupings across

PropertyTypeDescription
groupingsGroupings[]Information for each column grouping as a list.

Groupings

PropertyTypeDescription
valueStringValue of the field used as a row or column grouping. The value depends on the field’s data type.
keyStringUnique identity for a row or column grouping. The identity is used by the fact map to specify data values within each grouping.
labelStringDisplay name of a row or column grouping. For date and time fields, the label is the localized date or time.
groupingsArraySecond or third level row or column groupings. If there are none, the value is an empty array.
dategroupingsArrayStart date and end date of the interval defined by date granularity.

Grouping value by field data type:

  • Currency fields: amount (currency; value of a data cell) and currency (picklist; the ISO 4217 currency code, if available—for example, USD for US dollars or CNY for Chinese yuan; if the grouping is on the converted currency, this is the currency code for the report and not for the record).
  • Picklist fields: API name. For example, a custom picklist field, Type of Business with values 1, 2, 3 for Consulting, Services, and Add-On Business, has 1, 2, or 3 as the grouping value.
  • ID fields: API name.
  • Record type fields: API name.
  • Date and time fields: Date or time in ISO-8601 format.
  • Lookup fields: Unique API name. For example, for the Opportunity Owner lookup field, the ID of each opportunity owner’s Chatter profile page can be a grouping value.

Groupings down

PropertyTypeDescription
groupingsGroupings[]Information for each row grouping as a list.

See Also