Download Salesforce Attachment in SSIS


Download Salesforce Attachment in SSIS can be difficult the first time. In this new article, we will show how to download an Attachment from the Salesforce Source into a file using SSIS. Working with images is always tricky the first time. However, with the right article, this process is really simple. This article will show you how simple it is to do it.

Salesforce is an extremely powerful CRM based in the cloud. This company was created in California, San Francisco and it is a very common request to get the information from the cloud into a file automatically. These can be achieved with our ZappySys SSIS PowerPack plus some SSIS tasks.


In order to do it, we will need the following components:

  1. SSDT for SSIS installed
  2. ZappySys SSIS Powerpack installed
  3. A connection to Salesforce. In order to create a connection to Salesforce, check this video or check our article related.
  4. Finally, we will need a file in Salesforce to download.

Getting Started

Creating the connection

  1. First of all, in SSDT, create a new SSIS project
  2. In order to create a connection in SSDT, go to the connection manager, and select a new connection.
    Salesforce Connection


  3. Also, Select the ZS Salesforce connection. This new connection is created by the ZS SSIS PowerPack plugin mentioned in the requirements. With this connection, we can easily connect to Salesforce and get the Information.
    Select SSIS Salesforce

    Select SSIS Salesforce connection

  4. Finally, write your email, password, and token. For more information about getting the token, please check our article related.
    SSIS salesforce credentials

    Salesforce credentials in SSIS

Creating the package

  1. First of All, Drag and drop the Data Flow Task from SSIS Toolbox and double-click it to edit.
    Drag and Drop SSIS Data Flow Task from SSIS Toolbox

    Drag and Drop : Data Flow Task from SSIS Toolbox

  2. Secondly, in the Data Flow, we will use the Salesforce Source to connect to Salesforce and get the attachments.
    Drag and Drop Salesforce Source

    Drag and Drop: Salesforce Source from SSIS Toolbox

  3. For this purpose, we will use the attachment table from Salesforce.
  4. In addition, we will get the columns from the table. The image is in the body, however, we have additional columns like the id, name, ContenType, BodyLenght, createDate, and more:
    Salesforece columns in SSIS

    SSIS Salesforce Columns

  5. Next, we will need to drag and drop SSIS Derived Column from the SSIS Toolbox below the Salesforce Source and connect it.
    Drag and drop the Derived Column

    Drag and drop the Derived Column

  6. Double-click on the derived column, to specify the path to store the image in a local folder.
    saleforece download image

    SSIS-derived column download image salesforce

  7. Now let’s, drag and drop SSIS Export Column from the SSIS Toolbox >> Other Transforms.
    Drag and drop Export Column

    Drag and drop Export Column

  8. Double-click on the Export column to download an image of the body. In the Extract Column map the Body column of File data and the Path Column to where you want to save that file.
    Download attachment salesforce

    SSIS export column salesforce image

  9. Finally, we will use the trash destination to get the image and finish the flow.
    Destination ssis salesforce

    SSIS Trash destination

  10. Now, we are ready. Your package should be something like this:
    Download Salesforce Attachment in SSIS


  11. Run the package to test it.
  12. If everything is fine, we will be able to see the file. As you can see Downloading Salesforce Attachment in SSIS is a straightforward process.



In conclusion, we learned in this article how to Download Salesforce Attachment in SSIS. Basically, you need to use the ZappySys salesforce source, then use the derived column to specify the path and the Export column to get the image. Finally, the ZS Trash destination will be used  If you liked this article, do not hesitate to continue testing and using ZappySys PowerPack for SSIS.

Posted in REST API, SSIS Salesforce Source and tagged , , .