Creating Salesforce Attachments from Files in a Folder using the Filestream Connector

Creating Salesforce Attachments from Files in a Folder using the Filestream Connector

book

Article ID: KB0076278

calendar_today

Updated On:

Products Versions
TIBCO Cloud Integration - Connect ( Scribe ) -

Description

If you need to create attachments in Salesforce from files that reside in a folder you will need to utilize the Filestream connector to read the binary data to place into the attachment body in Salesforce.

The Filestream connector can be installed from the TIBCO Scribe® Marketplace.

The Filestream connector doesn’t have a Query block that would allow you to read files from a folder.  Instead, you need to have a source (Database Table, Text File, etc) that contains the path and filename of the file you want to use as the attachment.

You can use scripting tools, such as Powershell, to read the contents of a folder and write the path and filename to a table or text file if needed. Below is a link to an example Powershell script.
https://www.mssqltips.com/sqlservertip/5802/powershell-module-to-read-directory-contents-and-store-in-a-sql-server-table/

Issue/Introduction

This article describes the steps for creating attachments in Salesforce from files in the Windows folder structure

Resolution

Creating the Filestream Connection
Requires an On-Premise Agent
The Root Folder Path must be a valid path but the connector seems to ignore this value when reading the file.

User-added image
Creating the Map
For this example the source is a SQL Server table that has the location and name of the files to use as attachments
User-added image
User-added image
Specify the path & file name for the Filestream Read block.
Map the data to the Salesforce Attachment entity.

User-added image