Salesforce enforces a governor limit that prevents more than 50,000 records from being returned in a single SOQL query. This limit applies to both Attachments and Files when using the Mass File Download App. You'll notice a message beneath the Search button indicating:

“Searching up to 50,000 Attachments and up to 50,000 Files.”

To work within this limit and ensure you retrieve all necessary records, it’s important to narrow your search using filters, particularly the CreatedDate field. Below are examples of how you can apply these filters:


? List View: If you're using a List View, apply filters based on a specific time range, such as by month or year. You can then download the results for each time separately.

? SOQL Filters: Use CreatedDate in your SOQL queries to break large datasets into manageable chunks:

  • Filter Query Results Using Date Literals, for eg: CreatedDate = LAST_N_YEARS:1


  • Filter Query Results Using Dates of a specific range, for eg, CreatedDate >= 2023-01-01T00:00:00Z 

      AND CreatedDate < 2024-01-01T00:00:00Z


For more examples of valid date formats and filters, refer to the official Salesforce documentation:

? SOQL Date Formats and Date Literals