Skip to end of metadata
Go to start of metadata

Introduction

Module 1 in the Introduction to the Jitterbit Harmony Cloud Studio training course demonstrates querying data from a single table in a Postgres database and writing it to an SFTP server as a flat text file.

Prerequisites

These modules assume you have registered for the Jitterbit Learning Sandbox provided as part of the Introduction to the Jitterbit Harmony Cloud Studio training course. Registration for the Jitterbit Learning Sandbox provides access to the Jitterbit Harmony training organization, complete with two environments, as well as accounts on Jitterbit's training SFTP server and Postgres database.

If you do not have this access, see Getting Training to register for Jitterbit University, then enroll in the Introduction to the Jitterbit Harmony Cloud Studio course. Learning Sandbox Registration is covered in Chapter 4 – Learning Sandbox Registration.

Summary

In this module, you will connect to the customer table from the training Postgres database, c reate a CSV file with similar fields, and w rite that data to the training SFTP server.

The completed operation will look like this:

 

This operation uses this transformation mapping:

1. Create a New Project

All of the modules covered in this course are created in a single project. Before beginning the first module, create a project:

  1. Log in to the Jitterbit Harmony Portal at https://login.jitterbit.com and s witch to the Jitterbit Learning Sandbox organization within the top right of the header.
  2. Click the Cloud Studio application card.
  3. From the project index, click New Project. Give the project a name, such as "Jitterbit University Examples," and select the environment.
  4. Once within the project, rename the workflow to "Module 1."

    TIP: Adhering to an accepted naming convention within your organization for your workflows, operations, and components is a recommended best practice.

2. Configure a Database Connection

For this module, first you establish a connection to the Postgres training database:

  1. From the component palette's Connectivity tab under the Connectors filter, click the database connector:

  2. Configure the database connection:

    • Endpoint Name: "Postgres Database"
    • Driver: "PostgreSQL"
    • Server Name: "learningsandbox.jitterbit.com"
    • Database Name, Login, Password: These credentials are from the information you provided when completing the Learning Sandbox Registration form. This information can be found in the Learning Sandbox confirmation email.
    • Port: No changes from defaults are needed.

    TIP: Cloud Agents can use JDBC drivers only, while Private Agents can use JDBC or ODBC drivers.
  3. Click Test at the bottom of the configuration to verify connectivity.
  4. Once connected, click Save Changes. This returns you to the design canvas.

The Postgres database connection should have a configuration similar to this:

3. Configure a Database Activity

Next, you configure an activity to query data from the Postgres database:

  1. From the component palette's Connectivity tab under the Endpoints filter, click the "Postgres Database" connection you have just created to show associated activities below it:

  2. Drag a database query activity to the new component block within the workflow to create a new operation.
  3. Rename the operation to "DB to Text."
  4. Double-click the query activity within the operation to open its configuration.
  5. Configure the database query activity:
    • Name: "Query Customer Table"
    • Select Table(s): Refresh the tables and select the customer table. Click Next.
    • Select Fields: Select the id (Key), company, address, city, state, zip, country, phone, and fax fields. Click Next.
    • Data Schema: Review the data schema and click Finished to return to the design canvas.

The final screen of activity configuration should look similar to this:

4. Configure an FTP Connection

Next, you configure a connection to the training SFTP server:

  1. From the component palette's Connectivity tab under the Connectors filter, click the FTP connector:

  2. Configure the FTP connection :
    • Endpoint Name: "SFTP"
    • Host: "learningsandbox.jitterbit.com"
    • Username and Password: These credentials are from the information you provided when completing the Learning Sandbox Registration form. This information can be found in the Learning Sandbox confirmation email.
  3. Click Test  to verify connectivity and click Save Changes when done.

The FTP connection should have a configuration similar to this:

5. Configure an FTP Activity

Once the FTP connection is configured, you configure an FTP write activity associated with that connection:

  1. From the component palette's Connectivity tab under the Endpoints filter, click the "SFTP" connection you have just created to show associated activities below it:

  2. Drag an FTP write activity to the right of the database query activity within the operation on the design canvas.
  3. Double-click the FTP write activity within the operation to open its configuration.
  4. Configure the FTP write activity:
    • Name: "Write Customer Records"
    • Path: "/" (forward slash)
    • Filename(s): "result_[date]_[time].csv". Click Next.
    • Data Schema: Since you didn't provide a schema, there is nothing to review in the second screen. Click Finished.

6. Configure a Transformation

Next, you create a transformation to transform data from the database source to the FTP target:

  1. On the design canvas, hover over the area between the database query activity and the FTP write activity until a new component block appears.
  2. Click the block and select New Transformation. A new transformation will open for you to configure:
    • Transformation Name: "DB to Text"
    • Source: The source schema is already provided (on the left).
    • Target: You need to define the target schema (on the right). Click Define Schema, then select Create Flat. Configure the custom flat schema:
      • Schema Name: "Customer CSV"
      • Add Field: Use this button to add these fields: id, Customer, Address, City, State, ZipCode, Country, Phone, and Fax. Once the fields are added, click Save Changes.
  3. Along the top right of the target schema, click Automap Exact Matches.
  4. Manually map (drag and drop) the fields that weren't exact matches: map company to Customer, and zip to ZipCode.
  5. Along the top of the transformation header, click the gray Preview button to begin the preview process for testing and validating the mappings. Click Next to deploy the components listed and then click Finished.
  6. The preview screen displays data populated from the source and mapped to the target. Click the right and left arrows to cycle through the imported data.
  7. After reviewing the data, click Return to Workflow. Clicking this button saves the work you did in the transformation.

The custom flat schema configuration should look similar to this:

The transformation preview should look similar to this:

7. Deploy and Run the Operation

Finally, with all operation steps configured, you deploy and run the operation:

  1. In the top right of the operation, click the actions menu icon  and from the menu click Deploy and Run. The operation status is displayed in the lower left of the operation.
  2. Once the operation is successful, log in to Jitterbit's training SFTP server and view the file you generated.
On This Page

Last updated:  Jan 29, 2020

  • No labels