How to Attach Files to the Records in Salesforce

In this Salesforce tutorial, we will learn to attach files in Salesforce Record Pages and Email templates and discuss this method of attaching files in Salesforce Lightning and Salesforce Classic.

Attach Files to the Records in Salesforce

In Salesforce, attaching files to records is a better way to organize the information. With the help of these attachments, we can share information with anyone having access to these records. We can attach files such as MS Office documents, PDFs, images, and videos to most Salesforce records through the Files.

While working as a system administrator for an organization that uses Salesforce as a CRM tool, I was asked to attach files to the opportunity record pages. The reason behind that was the sales team, which frequently interacts with clients by sharing various documents, such as reports, contracts, and presentations. They decided to attach files to Opportunity Records to organize their sales processes and keep all required information in one place.

I will explain how to attach files to records using examples, and you can follow the same procedure to attach various files and documents to records of Cases, tasks, and campaigns.

We will discuss the file attachment in Salesforce through the following points.

  • Attach Files to the Records in Salesforce Lightning
  • Attach Files to the Records in Salesforce Classic
  • How to attach a file to an email template in Salesforce
  • Attach Files to Multiple Records in Salesforce

Limitations for attaching files in Salesforce

There are some limitations to uploading these attachments to Salesforce records.

  • In Salesforce Classic, the size limit for the attached file is 25 MB, while in Salesforce Lightning, it is 2GB.
  • The file size limit for Chatter feed attachments is 2 GB.
  • The size limit for an email message, including attachments, is 25 MB.
  • If the Don’t allow HTML uploads as attachments or document records security setting is enabled for your organization, you can’t upload files with the following extensions: .htm, .html, .htt, .htx.
  • Uploads from the Files-related list aren’t supported in the Salesforce mobile app.
  • Salesforce doesn’t remove geolocation information from uploaded images.

Attach Files to the Records in Salesforce Lightning

To attach Files to the records in Salesforce Lightning, navigate to the Setup page and follow the below steps.

1. On the Setup page, click on the App Launcher and navigate to the object tab, where you attach files to records.

Attach files to records in Salesforce

2. Select the record to which you want to attach files. In this case, I have selected the opportunity Edge Emergency Generator.

Add files to the Records in Salesforce Lightning

3. In the selected record, there are three tabs: Details, Activity, and Chatter. Click on the Details tab.

Salesforce Lightning Attach Files to opportunity records

4. In the Details tab, scroll down to Notes & Attachments and click on the Upload Files button.

Drop files in the attachments of Salesforce Record Page

5. In this step, open the file location and open the file you have to attach to the record. In this example, I have selected a .xlsx file Opportunity specifications to attach to the opportunity record.

Upload files to Salesforce Lightning Records

6. It will take a while to upload, and once the upload is complete, click on the Done button.

Salesforce Lightning Upload Files to opportunity records

As we click on the Done button, we can see the attached file in the section Notes & Attachments as shown in the picture below.

Attached Files to Opportunity Records in Salesforce Lightning

In this way, we have successfully attached or uploaded files to the records in Salesforce Lightning.

Attach Files to the Records in Salesforce Classic

To Attach Files to the Records in Salesforce Classic, login to your Salesforce account and follow the steps below.

1. On the Home page of Salesforce Classic, click on the Opportunities tab.

Attach Files to Opportunity Records in Salesforce Classic

2. In this step, select the opportunity record to which you have to attach files. In this case, I have selected the opportunity record name Elektron Technologies to attach files to it.

Salesforce Classic Attach Files to opportunity records

3. In the selected record, scroll down and go to the section Notes & Attachments and click on the button Attach File.

Salesforce Classic Attach Files to records

4. In this step, click on the Choose File button under the heading Select the File.

Choose File to attach in records in Salesforce

5. As we click on the button Choose File, it will open the browser, and from here open the file location. In this case, I have selected the file name Elektron Technologies Timeline. After selecting the file, click on the Open button.

Upload files to Salesforce Classic Records

6. In this step, click on the button Attach file, and when the upload is complete, the file information will appear below. Once the file has been uploaded, click on the Done button, as shown in the picture below.

Salesforce Classic Attached Files in records

As we click on the Done button, the file will be attached to the opportunity Records and we can see the attached file in the Notes & Attachments section.

Attached Files to Opportunity Records in Salesforce Classic

With this step, we have successfully attached a file to record in Salesforce Classic.

How to attach a file to an email template in Salesforce

The feature of attaching files is available in Salesforce Lightning and Salesforce Classic. We will discuss attaching files to an email template in Salesforce Lighting and Salesforce Classic.

Attach a file to an email template in Salesforce Lightning

To attach a file to an Email template in Salesforce Lightning, follow the below steps.

1. Click on the App Launcher and search, then select Email Templates.

Salesforce attach file to email template

2. Click on the template name to which you have to add an attachment.

3. Scroll to the Files section and click on Upload Files.

Attach file to email template in Salesforce

4. Browse the file from your system and click on Open.

5. After uploading the file, click on the Done button.

Salesforce Lightning email template attachment

The uploaded file will be visible in the Files of the Email template.

This way, we can attach a file to the Email template in Salesforce Lightning.

Attach a file to an email template in Salesforce Classic

To attach a file to a Classic email template in Salesforce, follow the below steps.

1. On the setup page of Salesforce Classic, go to the Administer section on the left sidebar and select Communication templates -> Classic Email templates.

Attach files to Email templates in Salesforce Classic

2. Click on the Email Template Name to which you need to attach files.

3. In the Email template, go to the section Attachments and click on the Attach File button.

Salesforce Classic Email template attach file

4. Now, you will see the instructions below for attaching the file.

  • Select the file from the browser; the file size should not exceed 25 MB.
  • Click the Attach file button. (repeat these two steps to attach multiple files).
  • Click Done.
Salesforce Classic Email template attach multiple files

In the Attachment section, we can see the attached file.

This way, we can attach files in Salesforce Classic templates.

Attach Files to Multiple Records in Salesforce

To attach files in multiple records, we can use the Salesforce data loader that is capable of managing big data. For this, you must have installed the Salesforce Data Loader tool in your system.

To attach the files using the Salesforce data loader tool, follow the below steps.

1. First, we need to create a CSV file to insert data with the data loader.

In the CSV file, add the columns Title, Description, VersionData, PathOnClient, and FirstPublishLocationId. In the columns, VersionData and PathOnClient, enter the file’s system path.

In the column FirstPublishLocationId, enter the ID of the object record to which you have to attach files, for example, Account, contacts, leads, and Opportunity.

Attach multiple files on Salesforce records

2. Open the Salesforce Data loader and click on the Insert button.

Attach multiple files on Salesforce records with data loader

3. Login with your credentials in the data loader.

4. Click the checkbox Show all Salesforce Objects, select the object Content Version, browse the CSV file we created, and click on the Next button.

How to attach multiple files to Salesforce records

5. In the Mapping window, click Create or edit a map. Then, in the next window, click Auto-match fields to columns. Now, the fields will auto-match to the header columns, and if they don’t, you have to drag the objects to the column mapping.

After this, click OK, then click Next.

Use Data loader to Attach multiple files

6. Click on the Finish button.

Import multiple files using the Salesforce data loader

7. As we click on the finish button, a warning message will appear, and here, click on the Yes button to proceed.

Use Data loader to Attach multiple files in records

8. As the data import is completed, we can see the number of successes and errors during the operation.

Click OK button to end the data operation.

Attach multiple files on Salesforce object records

9. Navigate to the object record and go to the Notes and Attachments section. The attached files will be there.

Add Multiple files in Salesforce records using data loader

This way, we can attach multiple files to records using the Salesforce data loader.

Conclusion

In this Salesforce tutorial, we have learned about attaching files to records in Salesforce Lightning and Salesforce Classic.

Along with this, we also learned to attach files in Salesforce Lightning and Classic email templates. We have used the Salesforce data loader tool to attach multiple files to a record.

By following all the above methods, you can attach files to the records in your Salesforce instance and organize your data.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.