Ask Your Question
2

What is the process for downloading all attached files from all records within a custom object in Salesforce?

asked 2022-08-10 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-05-08 18:00:00 +0000

plato gravatar image

There are a few ways to download all attached files from all records within a custom object in Salesforce. Here are the steps for one possible method:

  1. Create a new report for the custom object with the following columns: Record ID, File Name, and File ID. Make sure to add a filter to show only records where files are attached.
  2. Run the report and export the results to a CSV file.
  3. Open the CSV file in a spreadsheet program like Microsoft Excel or Google Sheets.
  4. Copy the File ID column and paste it into a new spreadsheet.
  5. In the second column of the new spreadsheet, create a formula that combines the File ID with the Salesforce instance URL and the download URL format. For example, if your Salesforce instance URL is https://example.my.salesforce.com, and the download URL format is /sfc/servlet.shepherd/document/download/, the formula would look like this: = "https://example.my.salesforce.com" & "/sfc/servlet.shepherd/document/download/" & A2
  6. Copy the formula down the column for all File IDs.
  7. Save the new spreadsheet as a CSV file.
  8. Use a program like wget or cURL to download all the attached files from the URLs in the second column of the CSV file. You can use a command like this: wget -i file_urls.csv -P /path/to/download/directory
  9. Wait for all files to finish downloading.

Note: This method may not work for large numbers of files or for files that exceed Salesforce's size limit. Additionally, downloading attachments in bulk may consume significant bandwidth and server resources, so it is recommended to use caution and consult with your Salesforce administrator before attempting this process.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-08-10 11:00:00 +0000

Seen: 12 times

Last updated: May 08 '21