by rssbus | November 21, 2017

Upload Files to Salesforce as Attachments

Download Package

Upload Files to Salesforce as Attachments

The sample project featured in this article has built-in ports for retrieving files from an SFTP server and uploading them as attachments into Salesforce. The project includes a mapping script that will prepare the files as documents to be inserted into your Salesforce account.

The ports are configured to automatically move files from one port to the next until the files downloaded from the SFTP server are sent to Salesforce. You can login to your Salesforce account to check for your new attachments.

The Script port and Salesforce port are already configured to automatically process incoming files. To make the process completely automated, you can set the SFTP port to poll the SFTP server for new records whenever you want the job to run from the SFTP port Automation page, or manually process files using the Receive button from the Receive tab of the SFTP port.

In order to configure the example, please follow these steps:

  1. Go to the Ports tab and click the Import Settings button. In the dialog that appears, choose the file to import the project's settings and port configurations.
  2. After you have imported the sample, start by selecting the SFTP port and navigating to the Settings tab. To establish a connection to an SFTP server, set the Remote Host and Remote Port fields, and then then appropriate Client Authentication method if necessary.
    After setting these credentials, click the Test Connection button. The application will notify that the server's key is unknown and it will ask to trust the key presented. Choose to trust the key where it will be added to the Server Thumbprint field, and the connection to the SFTP server should now be established.
  3. Next, open the Salesforce port and navigate to the Settings tab. If you have not installed the Salesforce port, the application will prompt you to install it.
  4. To connect to your Salesforce account, the User, Password and Security Token of your account need to be set to their respective fields. The User and Password are the same credentials you use to log into your Salesforce account, while the Security Token is a code assigned by Salesforce that is changed whenever you reset your password. If you do not know it, you can send a request to Salesforce from your account to have the token reset.
    After setting these credentials, click the Test Connection button to verify that you can connect to Salesforce from RSSBus Connect.
  5. You also need to specify a target to add the attachment to. Open the Script port and navigate to the Settings tab. In the Script section, locate the text YOUR_SF_OBJECT_ID_HERE, and replace it with the ID of the Salesforce object you want to add the attachment to, such as a lead, an organization or an account.
  6. To execute the sample, navigate to the Receive tab of the SFTP port. Click the Receive button to begin retrieving files and start exporting them to Salesforce as attachments.