Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityDoc feedbackLog In
GitHubNuGetDev CommunityDoc feedback


This article outlines how to set up an SFTP integration connection, create a recurring integration job to automate data exports from Optimizely <<product-name>>, and deliver files to an SFTP site.

SFTP support

The OOTB for SFTP only supports exports and does not support imports or reading from a specific folder.

## Create the SFTP connection (save to SFTP' site only)

Perform the steps in this section only if you want to deliver files to an SFTP site. If you want to save the exported data files locally, you do not need to complete this section.

  1. Go to **Administration \> Jobs \> Connections**.

  2. Click **Add Integration Connection**.

  3. Fill-in the following fields:

    • Enter **SFTP Connection** for the **Name**

    • Select **SFTP** for the **Type Name**

    • Select your time zone for the **Source Server Time Zone**

    • Enter your SFTP URL for the **Url**

    • Enter your SFTP site user name for the **User Name**

    • Enter your SFTP site password for the **Password**

    • Enter a folder name for the **Default Folder**

  4. Click **Save**.

## Change the storage provider setting (save locally only)

Perform the steps in this section only if you want to save the exported data files locally. If you want to deliver files to an SFTP site, you do not need to complete this section.

  1. Go to **Administration \> System \> Settings** and search for **Storage Provider**.

  2. Select **FileSystem** from the **Storage Provider** drop-down menu. When the job runs, it will save the exported data file under the specified storage provider directory.

  3. Click **Save**.

## Create the job definition

  1. Go to **Administration \> Jobs \> Job Definitions**.

  2. Click **Add Job Definition** to create a new Job Definition.

  3. Fill-in the following fields:

    • Enter a name for the **Job Name** that is Export Cart History

    • Select **Internal** for the **Connection**

    • Select **SqlQuery** for the **Preprocessor**

    • Leave **None** for the **Integration Processor**

    • Select **SftpFlatFile** for the **Post Processor** (Enter **SftpFlatFile** in this field if it doesn't show up in the drop-down menu.)

  4. Scroll to the Recurrence section. Select **YES** to **Run as a Recurring Job** and fill-in the fields that appear if you want to automate this job.

  5. Click **Save**.

## Add the job definition parameters

  1. Select the **Parameters** finger tab.

  2. Click **Add Job Definition Parameter** to add the first Job Definition Parameter.

  3. Fill-in the following fields:

    • Enter a name for the **Name**, that is FlatFileType

    • Select **String** for the **Value Type**

    • Enter **csv** for the **Default Value**

    • Enter **FlatFileType** for the **Prompt**

  4. Click **Save & Add New**.

  5. Fill-in the following fields:

    • Enter a name for the **Name**, that is Directory

    • Select **String** for the **Value Type**

    • Enter **\\userfiles** for the **Default Value**

    • Enter **Directory** for the **Prompt**

  6. Click **Save** then **Back**.

## Add the job definition step

  1. Select the **Steps** finger tab.

  2. Click **Add Job Definition Step**.

  3. Fill-in the following fields:

    • Enter **1** for the **Sequence**

    • Enter a name for the **Step Name**, that is Cart History

    • Select **Cart** for the **Target Object**

    • Select **SFTP Connection** for the **Connection Override** (if you want to save the file locally, this is not needed)

      If you don't see the SFTP Connection you created in the first section, go back to your SFTP Connection and change the **Type Name** to something else (that is Flat File). Try this step again and you should see your SFTP Connection in the drop-down menu. Then, return to your SFTP Connection and change the **Type Name** back to **SFTP**.

    • Select **Ignore** for **Action** under Delete Behavior

    • Enter **OrderNumber** (and any other desired information) for the **Select Clause**

    • Enter **CustomerOrder** for the **From Clause**

    • Enter **Status='Submitted'** for the **Where Clause**

  4. Click **Save** then **Back**.

## Schedule the job

Schedule the job, then it will save the exported data file either under the specified storage provider directory or under the **Default Folder** you specified in your SFTP Connection.

  1. Click **More Options** and select **Schedule Job**. The Schedule Job window appears. 

  2. Select the date and time and whether this job should run in real time (more frequently than the default interval the WIS uses to ping your website), then click **Schedule Job**.

    Note

    If you want to set this job up as a recurring job, select the **Details** finger tab and scroll to the Recurrence section. Select **YES** to **Run as a Recurring Job** and fill-in the fields that appear.

## Sample of the completed job definition

Code Sample: SFTPFlatFile DataExport (JSON)