Export Records to CSV
sf_export_recordsExport Salesforce records as CSV with a SOQL query. Extract, backup, or analyze data with customizable headers and record limits.
Instructions
Exports Salesforce records as CSV data using a SOQL query. Useful for data extraction, backup, or analysis.
soql: the SOQL query to run (SELECT fields FROM Object WHERE ...) includeHeader: include column headers in the CSV output (default: true) maxRecords: maximum records to export (default: 50000 — use Bulk API for larger datasets)
Returns the CSV content as a string. For very large exports (>50k records), use sf_bulk_import_records with operation='query' instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum records to export | |
| query | Yes | Full SOQL query string | |
| format | No | Export format: json or csv | |
| includeHeaders | No | Include CSV header row |