Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Get Report Metadata

Report metadata gives information about a report and its report type. It includes information on fields used in the report for filters, groupings, detailed data, and summaries. You can use the metadata to do several things.

  • Find out what fields in the report type you can filter on and by what values.
  • Build custom chart visualizations using the metadata information on fields, groupings, detailed data, and summaries.
  • Change filters in the report metadata during a report run.

To get report metadata, send a GET request to the Describe resource.

Example

This GET request, /services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/describe, to the Describe resource returns metadata for a matrix report. This includes a bucket field, groupings, summaries, and a custom summary formula.

1{
2    "reportTypeMetadata": {
3        "categories": [
4            {
5                "label": "Opportunity Information",
6                "columns": {
7                    "CREATED": {
8                        "filterValues": [],
9                        "label": "Created By",
10                        "dataType": "string",
11                        "filterable": true
12                    },
13...
14                    "TYPE": {
15                        "filterValues": [
16                            {
17                                "name": "Add-On Business",
18                                "label": "Add-On Business"
19                            },
20                            {
21                                "name": "New Business",
22                                "label": "New Business"
23                            },
24                            {
25                                "name": "Services",
26                                "label": "Services"
27                            }
28                        ],
29                        "label": "Type",
30                        "dataType": "picklist",
31                        "filterable": true
32                    },
33        }
34...
35    },
36    "reportExtendedMetadata": {
37        "detailColumnInfo": {
38            "OPPORTUNITY_NAME": {
39                "label": "Opportunity Name",
40                "dataType": "string"
41            },
42            "PROBABILITY": {
43                "label": "Probability (%)",
44                "dataType": "percent"
45            },
46            "EXP_AMOUNT": {
47                "label": "Expected Revenue",
48                "dataType": "currency"
49            },
50            "NEXT_STEP": {
51                "label": "Next Step",
52                "dataType": "string"
53            },
54            "BucketField_34840671": {
55                "label": "Industry",
56                "dataType": "string"
57            }
58        },
59        "aggregateColumnInfo": {
60            "RowCount": {
61                "label": "Record Count",
62                "dataType": "int",
63                "downGroupingContext": null,
64                "acrossGroupingContext": null
65            },
66            "FORMULA1": {
67                "label": "formula1",
68                "dataType": "double",
69                "downGroupingContext": "ALL_SUMMARY_LEVELS",
70                "acrossGroupingContext": "ALL_SUMMARY_LEVELS"
71            },
72            "s!EXP_AMOUNT": {
73                "label": "Sum of Expected Revenue",
74                "dataType": "currency",
75                "downGroupingContext": null,
76                "acrossGroupingContext": null
77            }
78        },
79        "groupingColumnInfo": {
80            "CLOSE_DATE": {
81                "label": "Close Date",
82                "dataType": "date",
83                "groupingLevel": 1
84            },
85            "STAGE_NAME": {
86                "label": "Stage",
87                "dataType": "picklist",
88                "groupingLevel": 0
89            },
90            "ACCOUNT_NAME": {
91                "label": "Account Name",
92                "dataType": "string",
93                "groupingLevel": 0
94            },
95            "ACCOUNT_LAST_ACTIVITY": {
96                "label": "Account: Last Activity",
97                "dataType": "date",
98                "groupingLevel": 1
99            }
100        }
101    },
102    "reportMetadata": {
103        "name": "Stuck Opportunities",
104        "id": "00OD0000001ZbP7MAK",
105        "currency": null,
106        "developerName": "StuckOpportunities",
107        "groupingsDown": [
108            {
109                "name": "ACCOUNT_NAME",
110                "sortOrder": "Asc",
111                "dateGranularity": "None"
112            },
113            {
114                "name": "CLOSE_DATE",
115                "sortOrder": "Desc",
116                "dateGranularity": "FiscalQuarter"
117            }
118        ],
119        "groupingsAcross": [
120            {
121                "name": "STAGE_NAME",
122                "sortOrder": "Desc",
123                "dateGranularity": "None"
124            },
125            {
126                "name": "ACCOUNT_LAST_ACTIVITY",
127                "sortOrder": "Asc",
128                "dateGranularity": "Week"
129            }
130        ],
131        "reportType": {
132            "type": "Opportunity",
133            "label": "Opportunities"
134        },
135        "aggregates": [
136            "s!EXP_AMOUNT",
137            "FORMULA1",
138            "RowCount"
139        ],
140        "reportFormat": "MATRIX",
141        "reportBooleanFilter": null,
142        "reportFilters": [
143            {
144                "value": "Closed Won,Closed Lost",
145                "column": "STAGE_NAME",
146                "operator": "notEqual"
147            },
148            {
149                "value": "50",
150                "column": "PROBABILITY",
151                "operator": "greaterThan"
152            }
153        ],
154        "detailColumns": [
155            "OPPORTUNITY_NAME",
156            "PROBABILITY",
157            "EXP_AMOUNT",
158            "NEXT_STEP",
159            "BucketField_34840671"
160        ]
161    }
162}