Export and Import Functionalities in Salesforce | All You Need to Know

Export and Import Functionalities in Salesforce | All You Need to Know

To move attachment data from one Salesforce org to another, from one object to another, or to import from one place, you must follow two basic rules for exporting and importing. 

Export Attachments in Salesforce

  1. Login to http://dataloader.io with your login to Salesforce.

Note: You can use any data loading tool such as Data Loader, Dataloader.io or Talend 

  1. Assuming you are using Dataloader.io, click New Task and select the Export button.
  2. Select Attachment object, click Next.
  3. Select the list of fields and whether to apply filters, then click Next, or use the following SOQL query to query for example attachments on the Account object. You can use any item to download from that specific item or all items.

 

 

 
  1. Click “Save & Run”.
  2. Wait the process.
  3. After the task is complete, click the link next to the export task in Task Manager to download the attachment. This will download all attachments zipped into her one .zip file, example: Attachment Export-Demo.zip
  4. Select any other field above the text box to find a CSV file with the same name. For example: Attachment Export-Demo.csv. All the fields she chose when exporting to dataloader.io are available in her CSV file.

dont miss out iconDon't forget to check out: Introduction to Creating and Using Salesforce Reports

Import Attachments in Salesforce

  1. Create an attachments.csv file (the name of the file doesn't matter) with the following column headings: 
    • ParentId: Record’s ID to which the attachment should be associated
      Name: Name of the attachment
      ContentType: Format of extension (e.g. .xls, .pdf, etc)
      OwnerID: ID for the owner of the attachments
      Body: File path to the Attachment on the local System.(C:\documents and settings\schun\desktop\attachments\file.xls) 
  2. Log in to the Data Loader
  3. Select the “Insert” Command
  4. In the Select Salesforce Objects step, select the Show All Salesforce Objects check box and select Attachments
  5. Choose the attachments.csv file
  6. Map the following fields, in the mapping step:
    • Parent ID 
      Name 
      Owner ID
      Body: Map the previously created Body column to the file extension. How to determine the file and location of the attachment to insert. 
  7. Click “OK” to proceed with the insert. It may take a few minutes, but the attachment is successfully uploaded to your Salesforce org.
  8. Also, make sure you are using a valid Parent ID/Owner ID as the Parent ID will be different in the second org. Therefore, these attachments are added to the correct records.

dont miss out iconCheck out another amazing blog by Nikhil here: Apex Triggers in Salesforce | Here’s What you Need to Know

Responses

Popular Salesforce Blogs