Sub topic 4
Exporting Reports for Small, Targeted Extracts
This chapter assumes you know Salesforce objects, fields, and report types, and can read a CSV file. Reports are the quickest way to pull a small, filtered slice of data without writing a query. They are not a backup tool, and the limits below explain why.
When a report export fits
A report export suits a narrow, one-off need. Examples are the open opportunities for one region, or the accounts that changed this week. Business users can build these reports without a developer.
A report is a poor fit when you need:
- Every record of an object. Reports have row limits.
- A repeatable, complete backup. The export depends on the report's filters and columns.
- Fields that the report type does not expose.
For full backups, use the methods in later chapters.
Export steps
- Open the report in Lightning Experience.
- Choose Edit, then check the filters, columns, and the Show scope (for example, All accounts or My accounts).
- Open the dropdown beside Edit and choose Export.
- Choose Formatted Report or Details Only.
- For Details Only, pick a format such as CSV or XLS. Choose Export.
Formatted Report keeps the grouping and layout, so it is easier to read. Details Only gives flat rows, which is better for loading into other tools.
Limits to know
| Limit | Effect |
|---|---|
| Row cap | Exports are capped, and rows beyond the cap are left out silently. Check the current limits in the Salesforce documentation for your edition. |
| Report type | Only fields in the report type can appear. |
| User access | You only see records and fields your profile and sharing rules allow. |
| Scope | A "My" scope exports only your own records. |
| IDs | Record Ids are not included unless you add them. |
The access rule matters most. A report run by a user with narrow sharing returns a partial result without any warning.
Making the export usable
Add the record Id column, using a report type that offers it. Without Ids you cannot match rows back to records or rebuild relationships on restore. Also add the parent Id fields you need, such as the Account Id on a contact report.
Use filters that you can reproduce. A date filter on Last Modified Date gives the same result when you run it again, while "Created This Week" changes over time.
Report or query?
Common mistakes
- Exporting with the wrong scope, so only your own records appear.
- Leaving out the Id column, which makes the file unusable for restore.
- Treating a formatted export as data. Subtotals and headers break CSV parsing.
- Storing the file unprotected. Reports often contain personal data, so treat the file like any other export.
Exercise
A colleague exports a "Customer Accounts" report as a backup. The CSV has no Id column, and the row count is lower than SELECT COUNT() FROM Account. Give two reasons the export is unsuitable as a backup.
Show answer
Without Ids, the rows cannot be matched to existing records or used to rebuild relationships on restore. The lower count shows the report is partial, which can come from report filters, scope, row limits, or the user's sharing access. A backup needs a complete, verifiable export, so use the Data Export Service or a SOQL-based tool.