Export Data from Salesforce

Export Salesforce data in Dataloader from MuleSoft by creating an Export task. Each task stores your connection, query, and options so you can save and run it immediately, schedule it, or reuse it as a template.

Start a new export task and select the Salesforce org and object to export from.

  1. Click New Task then click Export.

    New Task menu with Export selected.

  2. In the Connection dropdown, select the Salesforce connection you want to use.

    Your login credentials apply to your default connection. To use a different Salesforce connection, click the + icon and create a new connection.

  3. For Object, select the object you want to export data from, such as Account, Contact, or Lead. Click Next.

    Export task Connection and Object step with connection, object list, and Next.

Object list: Use Quick find to search for an object by name. Use Menu to filter Standard or Custom objects or to show or hide object names.

Use the four areas on the page to define what to export: fields (including related objects), filters, sort order, and the SOQL that Dataloader builds from those choices. You can review or edit that SOQL directly when you need a custom query.

  • Left: Select the fields for the selected object and related objects.

  • Filters section: Add filters so you export only rows that match your criteria.

  • Below filters: Choose how to order the data.

  • SOQL section: Review the SOQL built from your selections, or write and edit your own query in the SOQL query editor.

Export query builder with fields, filters, order by, and generated SOQL for Contact.

You can build your query with the query builder (fields, filters, and order) or by writing your own query in the SOQL query editor.

To select fields, click them in the list. To select all fields, use the Select All checkbox for the object.

Fields panel for Contact with Contact ID, Account ID, Assistant's name, and Assistant Phone fields checked.

Field list: Use Quick find to search fields. Use Menu to show selected or all fields and to show or hide field names.

Fields panel with Quick find on Contact, Contact ID checked, and MasterRecord fields listed.

To add filters to your query:

  1. Select an object. By default you use the one you selected earlier; you can also choose a related object.

  2. Select a field and select the operator.

  3. Enter the filter value.

  4. Click the + icon to add the filter.

To delete a filter, click the delete icon for that filter.

Choose a field to sort your data from the selected object or a related object.

  1. Select the Object that contains the sort field.

  2. Select the field to sort by.

  3. Select the sort order: Asc (ascending) or Desc (descending).

As you select fields, filters, and ordering options, Dataloader from MuleSoft turns your choices into SOQL. Open the SOQL Query section to see the code that Dataloader sends to Salesforce.

SOQL Query box with Verify and Reset and a Contact query using WHERE and ORDER BY.

The SOQL Query section also enables you to write your own queries without the query builder. Click Verify to confirm the query before you run the task.

Set the order of columns in a CSV file by editing the order of selected fields in a SOQL query. The query below produces a table with the columns FirstName, LastName, Email, and Phone in that order.

SOQL Query with Verified status.

After you make changes in the SOQL Query editor you can no longer use the Query Builder. To return to selecting fields and filters from the dropdown menus, click Reset. Resetting the SOQL query discards custom edits to the SOQL statement and restores the options you selected earlier.

Find more about the SOQL query language in the SOQL and SOSL reference.

Review the summary page, adjust the task name, API, and other options, then save the task or run it immediately.

  1. On the summary page, review the overview of your task (task name, main object, operation, export row count).

  2. Optional: Change the task name.

  3. Specify the Bulk API or the Batch API and set the batch size if needed.

  4. Optional: Open advanced settings in the task configuration.

  5. Click Save to save and run later, or Save and Run to run immediately.

Contact export Run step with summary, Bulk API, email results, Advanced, and Save and Run.

  1. Set how often the task runs: Hourly, Daily, Weekly, or Monthly.

  2. Set the time zone if needed.

  3. After you create the task, open scheduling from this summary page (edit the task and return here) or from the Schedule button on the task list.

  4. Use the Scheduled tab to find scheduled tasks.

Salesforce Bulk API uses REST principles and is optimized for loading or deleting large data sets. Salesforce processes records asynchronously by running submitted batches in the background.

Bulk API has some restrictions. For example, related object exports are not supported.

Bulk API processes data in larger batches than Batch API, which lowers API usage per operation when you load large volumes. For more information, see Introduction to Bulk API 2.0 and Bulk API.

When the Bulk API checkbox is cleared, Batch API is in use.

Salesforce Batch API uses SOAP principles and is optimized for real-time client applications that update small numbers of records at a time. Although the SOAP API can process large numbers of records, data sets with hundreds of thousands of records are less practical that way.

For large volumes, Bulk API is the best option. Batch API processes data in smaller batches than Bulk API, which increases API calls per operation when you process large volumes.

FeatureBulk APIBatch API
ProtocolRESTSOAP
Best forLarge data sets (10,000+ records)Smaller data sets (under 10,000 records)
ProcessingAsynchronous batchesReal-time
API callsLower (larger batches)Higher (smaller batches)
Related object exportsNot supportedSupported

You can configure your task to email you whenever it runs. You can add multiple recipients as well as multiple CCs to the sent email.

When using the free edition of Dataloader from MuleSoft, you are only allowed to have one task set up to send email notifications. Dataloader.io Professional and Enterprise editions allow you to use email notifications on unlimited tasks.

These options appear on the Advanced settings page.

  • Export Deleted Rows: Available only with the Batch API. Includes rows from the Salesforce Recycling Bin in your export results.

  • Row Limit: Limits how many rows the export returns. With the Batch API and large exports, you can set the limit below 10,000 records when needed.

  • Date Format: Available when you select Batch API. Sets the date format for export results: American (MM/DD/YYYY) or European (DD/MM/YYYY).

  • Serial Mode: Available only when you select Bulk API. Processes batches one at a time in Salesforce (which helps avoid database contention). This option can significantly increase processing time for a load.
  • Timeout: Maximum time a task can keep running. When the task reaches the threshold, Dataloader cancels it automatically. The default timeout is 2 hours.
  • Stronger Security: Dataloader from MuleSoft uses strong server-side encryption and provides access to resulting files only to their owners. You can remove data from Dataloader servers by deleting the task in the task menu.

    You also control where CSV data is stored. Click Save Result Files Externally under Advanced settings so Dataloader doesn’t store CSV files on its servers. This feature is available only when you use external storage such as Dropbox, Box, or (S)FTP to save result files.

    With this option selected, you cannot download resulting files from the main page.

Advanced export settings for deleted rows, row limit, date format, serial mode, and timeout.

When creating a filter you have several options available based on the type of field you are using:

  • equals
  • non equals
  • starts with
  • ends with
  • contains
  • does not contain.
  • is empty
  • is not empty.
  • like
  • not like

like and not like are useful if you want to use wildcards such as % or _.

  • = equals to.
  • != non equals to.
  • > greater than.
  • >= equals or greater than.
  • < smaller than.
  • <= equals or smaller than.
  • is empty
  • is not empty.
  • = equals to.
  • != non equals to.
  • = equals to.
  • != non equals to.
  • is empty
  • is not empty.

By default, after an export task runs in Dataloader from MuleSoft, you get the file from the latest run in the task manager or from the task history, then download it through your browser.

Alternatively, send results straight to a folder when the task runs, for example on an FTP server or in cloud storage. For setup details, see Connecting to Box, Connecting to Dropbox, Connecting to FTP, and Connecting to SFTP.

You can use a fixed file name so each run overwrites the previous file, or add a timestamp to keep every export as a separate file.

Run step showing Dropbox destination folder New Contacts for exported CSV results.