cancel
Showing results for 
Search instead for 
Did you mean: 

Basics of SnapLogic

pawit_roy
Employee
Employee

 

Introduction

SnapLogic is a cloud-based integration platform-as-a-service (iPaaS) that provides tools for connecting various applications, data sources, and APIs. It enables businesses to automate and streamline their data integration processes by offering pre-built connectors and a visual interface for designing integration workflows.

The SnapLogic platform uses a SnapLogic pipeline, a series of connected "Snaps" (pre-built components) that define the flow and transformation of data between various systems and applications. In a SnapLogic pipeline, data flows from one Snap to another, with each Snap performing a specific function, such as data extraction, transformation, or loading (ETL).

image45.png

SnapLogic Designer

The SnapLogic Designer is the user interface that enables you to develop pipelines. You can see the example page below.

pawit_roy_0-1727893056804.pngBut in SnapLogic with a feature called “Asset Palette,” you may see the different styles of Side Panel view. But the features are the same as those of the side panel view.pawit_roy_1-1727893056630.png

 

The designer page consists of three main parts:

  • Canvas - The field for visualizing and editing the pipeline

pawit_roy_2-1727893192967.png

 

 

  • Toolbar - The list of tools for the pipeline

pawit_roy_5-1727893192701.png

 

Icons

Description

Execute Pipeline

pawit_roy_6-1727893192618.png

 

Execute the pipeline.

Validate Pipeline

pawit_roy_7-1727893192703.png

 

Validate the pipeline. Any unsaved changes will be saved before validation. Clicking the button while a validation is in process cancels that validation. Shift-clicking the button will clear the cache before validating.

Edit Pipeline Properties

pawit_roy_8-1727893192714.png

 

You specify properties when creating a pipeline. Click this button to modify the properties.

Check Pipeline Statistics

pawit_roy_9-1727893192665.png

 

As a pipeline executes, the statistics are updated periodically so that you can monitor its progress.

Create Task

pawit_roy_10-1727893192703.png

 

Create a Task for the current pipeline.

Save Pipeline

pawit_roy_11-1727893192702.png

 

Save the current pipeline.

Export Pipeline

pawit_roy_12-1727893192706.png

 

Export the current pipeline.

Copy Pipeline

pawit_roy_13-1727893192699.png

 

Copy the pipeline from one project to another.

Move Pipeline

pawit_roy_14-1727893192615.png

 

Move the pipeline from one project to another.

Delete Pipeline

pawit_roy_15-1727893192622.png

 

Delete the current pipeline

Pipeline Versions

pawit_roy_16-1727893192615.png

 

Create versions of the pipeline.

Compare Pipeline

pawit_roy_17-1727893192616.png

 

Compare the current pipeline with the target pipeline.

Notes

pawit_roy_18-1727893192623.png

 

Add a note or delete an existing note. Notes are saved with the pipeline.

Print

pawit_roy_19-1727893192632.png

 

Print the pipeline.

Snaps

Snaps are the building blocks of a pipeline. Each Snap performs a single function, such as reading, parsing, transforming, or writing data. You can view the Snaps available to you (or your account) in the Snaps Catalog on the left-hand side of the SnapLogic Designer. You can drag a Snap from the Snap Catalog onto the Canvas to use it in a pipeline.

pawit_roy_21-1727894128209.png

Snaps Type

SnapLogic includes the following basic types of Snaps with distinct icons.

Icon

Snap Type

Description

pawit_roy_22-1727894127890.png

 

Read

Specifies data sources in the pipeline.

Examples: File Reader, CSV Generator, Birst Query

pawit_roy_23-1727894127882.png

 

Parse

Takes the input of unstructured data and generates an output of structured data.

Examples: XML Parser, Sequence Parser, JSON Parser

pawit_roy_24-1727894127909.png

 

Transform

Modifies data significantly.

Examples: Mapper, Aggregate, Join

pawit_roy_25-1727894127890.png

 

Flow

Changes the output or direction of data in a pipeline.

Examples: Router, Gate, Union

pawit_roy_26-1727894127891.png

 

Format

Changes the data format.

Examples: CSV Formatter, JSON Formatter, Excel Formatter

pawit_roy_27-1727894127890.png

 

Write

Specifies data destinations in a pipeline.

Examples: File Writer, REST Post, Email Delete

Connecting Snaps

The key to creating a Pipeline in SnapLogic is connecting Snaps. There are a few things to consider when placing Snaps in a Pipeline.

Connection Shapes

Like puzzle pieces, only Snaps with matching connection pairs (circles or diamonds) can be connected between the input and output of two snaps.

pawit_roy_28-1727894213780.png

pawit_roy_29-1727894213760.png

When you drag a snap and place it next to or in front of another snap, the snap will automatically connect both snaps, and the connection will change color, which means it connects successfully. If the color doesn’t change, you need to recheck that both connection shapes are the same and re-connect it again.

pawit_roy_30-1727894213804.png

Disconnect Linked Snaps

Unlinked Snaps can be moved apart or placed next to each other. Make sure the circle or diamond connector is colored Blue, which indicates that the Snaps are linked.

pawit_roy_31-1727894213819.png

 

pawit_roy_32-1727894213751.png

 

To disconnect linked Snaps, click on the Blue connector. This clears the color and allows you to rearrange the Snaps.

Remote-Connect Link Snaps

You can connect to Snaps, but not next to each other, using a remote-connect link. For example, click and hold on the Mapper Snap connector until it turns Yellow, then drag it to the Copy Snap connector. When both connections turn Blue, release the mouse button. A number is placed in both connectors to let you know they are connected.

pawit_roy_33-1727894214267.gif

Note: The number is only temporary until the Pipeline is saved. At this point, a new, permanent number may be assigned.

You can also click and hold on one connection, and both Snaps connected by this link will darken. This feature is helpful for large pipelines where it may take much work to visualize the connections quickly.

pawit_roy_34-1727894213816.png

Data model

SnapLogic will pass the data between snaps with two models:

Document data

The document data models will represented by a circle shape. This data type uses the JSON format as a container of the data. The support data type in this model is similar to the JSON standard in that it includes string, boolean, number, array, object, and null.

pawit_roy_35-1727894331101.png

Binary data

The document data models will represented by a diamond shape. This data type will wrap the binary data in SnapLogic’s model. Mostly, this will be inputted to the file writer and parser and outputted from the file reader and formatter.

pawit_roy_36-1727894331101.png

Configuration Snaps

You have two options to open the configuration dialog. First, left-click on the snap that you want to configure. The dialog will show up immediately. 

pawit_roy_37-1727894331331.png

The second way is right-clicking at the snap, and the menu displays options available in all Snaps through a dropdown list will be shown. Then click “Edit” in the menu.

pawit_roy_38-1727894331073.png

Each snap will have different configurations. You can learn more about the configuration of each snap by clicking the question mark icon on the top right of the dialog.

pawit_roy_39-1727894331548.png

Expression

pawit_roy_40-1727894416647.png

The SnapLogic expression language is a utility that is available to Snaps. You can use expressions (JavaScript syntax) to access functions and properties to set field values dynamically. You can also use the expression language to manipulate data. 

Example

$text == "NFL" ? "foo" : "bar"

$counter > 1 ? ($counter < 3 ? 50 : 100) : -1

Expressions are available across multiple Snaps. If the Snap exposes the functionality of the expression for a property, then the pawit_roy_41-1727894416645.png icon appears in front of the property's text box. You can toggle on or off by clicking on the icon. When the toggle is on, the down arrow within the field will appear. You can click to see the list of functions and properties available.

 

pawit_roy_42-1727894417041.png

Operations

List of supported and unsupported operations available on (document https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438042/Understand+Expressions+in+the+Snap...)

Accessing Pipeline Parameters

Parameters allow a pipeline to be reused in multiple situations. For example, a File Writer Snap can be configured to write to a file path specified by a parameter, which allows the same pipeline to write to different files. The parameters for a pipeline can be defined by using the Edit Pipeline properties dialog. The name of each parameter must only contain alpha-numeric characters, and the value will be converted to a string. The value for a parameter defined in the pipeline properties dialog is treated as the default when running the pipeline in Designer. Parameters can also be passed to a pipeline by a Task or the ForEach Snap. Any parameters not passed down from the Task or Snap will use the defaults specified in the properties dialog.

To access a pipeline parameter from the expression language, you must prefix the parameter name with an underscore. For example, given the following parameters:

Key

Value

firstName 

Bob

numValue

12

path

$.age

The "firstName" parameter can then be accessed using _firstName, as in:

"Hello, " + _firstName  // result: Hello, Bob

Since the value of a parameter is always a string, you'll need to convert any string to numeric values before operating on them. For example, simply adding two to the "numValue" parameter will append the character "2" to "12" and yield "122":

_numValue + 2   // result: "122"

Instead, you need to use the parseInt/parseFloat functions to parse the string into a value and then add two to it:

parseInt(_numValue) + 2   // result: 14

You need to parameterize your pipeline with an expression. You can use the eval() function to evaluate an expression stored in a string.  For example, to read the document field specified by the "path" parameter, you can use:

eval(_path)   // result: <the value of the "age" field in the current document>

Accessing Input View Variables as Part of Expressions

An input view schema attribute can be used as part of the expression using the dollar sign ($) prefix.

Example

The REST Put Snap provides a URL. The URL can be toggled into an expression, and the expressions could be created by dynamically substituting the variables from an input view, such as:

'http://someplace:someport/somepart/' + $inputvar + '/somemoreparts'

Accessing secret value from the secrets manager

Any expression-enabled authentication field in a Snap or Account can be used with Secrets Management. You can enter an expression that retrieves a secret stored in your secrets manager, such as an access token, a username, or a password. To use the values from the secrets manager, you must first create secrets myaccesskey and mysecretkey in the Secrets Manager vault. Then, create or modify the Account and enter an expression in the required fields. Learn more: Configure Accounts to use secrets.

Account

An account represents an object that encompasses details to connect to an endpoint. Accounts play a crucial role in integrating applications. Any Snap that communicates with an external endpoint needs an authenticated account to access the resources on the endpoint. For example, a MySQL Snap requires authenticated access to a MySQL database. In SnapLogic, you create an Account to store credentials and any other information necessary to connect, such as a URL, hostname, and port number.

pawit_roy_43-1727894539965.png

You can create an account from Designer or Manager. In Designer, when working on pipelines, every Snap needing an account prompts you to create a new account or use an existing one.

To use an existing account, you can click the dropdown icon to show all the available accounts for the snaps.

pawit_roy_54-1727894848357.png

To create a new account, click the “Add Account” button below the property field and follow the steps. The account will be created in your selected location on the first step. You can manage the created account on the Manager page in that location.

pawit_roy_45-1727894539989.png

pawit_roy_46-1727894540137.png

Note: You can learn more about account type and each property by clicking the icon question mark in the top right corner.

Validation & Execute Pipeline

Sometimes, we want to test the pipeline by dry-running it without running the write snaps. You can use the validate function pawit_roy_47-1727894539848.png on the toolbar menu. The difference between validate and execute is before each snap runs. It will check the property called “Snap execution.” There are three opinions on how to trigger the snaps.

 

pawit_roy_48-1727894539904.png

  • Validate & Execute - this option makes the snaps run on both the validation and execution steps.
  • Execute only - this option makes the snaps run on only the execution step. The snap writer type uses this as a default value.
  • Disabled - this option prevents the snaps from running.

Note: By default, the validation will be triggered every time we change the configuration of the snaps in the pipeline.

Preview Data

pawit_roy_49-1727894539922.png

After executing or validating the pipeline, they will have a preview icon in the connection joint. The preview dialog will appear when you click on it, showing the snaps' output data. For example, when we click the preview icon, the pipeline above will show output data from JSON Generator snaps.

pawit_roy_50-1727894540145.png

The preview dialog has three types: JSON, Table, and Raw. You can select the dropdown on Preview Type and choose the type you like.

  • JSON

pawit_roy_51-1727894540124.png

  • Table

pawit_roy_52-1727894540145.png

  • Raw

pawit_roy_53-1727894540297.png

Create First Pipeline

This section will show how you start creating the pipeline, from the requirement to checking the result and running the final pipeline.

For the example scenario, we want to calculate the employees list to check who needs to be assigned marketing training. The list of our employees looks like the data below.

[
    {
        "Name": "Albert Maro",
        "Location": "Field",
        "Extension": 4357,
        "Email": "amaro@company.com",
        "Title": "Director, Eastern US",
        "Department": "Sales",
        "Dept ID": 1100
    },
    {
        "Name": "Anthony Dunn",
        "Location": "HQ",
        "Extension": 4387,
        "Email": "adunn@company.com",
        "Title": "Social Media Director",
        "Department": "Marketing",
        "Dept ID": 1200
    },
    {
        "Name": "Rich Harris",
        "Location": "CO",
        "Extension": 4368,
        "Email": "rharris@company.com",
        "Title": "Principal Developer",
        "Department": "Engineering",
        "Dept ID": 1300
    }
    // more data
]

The constraint of needing training is an employee in the marketing department working at “HQ.” We want the list of employees with Firstname, Lastname, Email, Title, and Training fields. The result should look like below.

[
    {
        "Firstname": "Albert",
        "Lastname": "Maro",
        "Email": "amaro@company.com",
        "Title": "Director, Eastern US",
        "Training": false
    },
    {
        "Firstname": "Anthony",
        "Lastname": "Dunn",
        "Email": "adunn@company.com",
        "Title": "Social Media Director",
        "Training": true
    },
    {
        "Firstname": "Rich",
        "Lastname": "Harris",
        "Email": "rharris@company.com",
        "Title": "Principal Developer",
        "Training": false
    }
    // more data
]

Steps

1. Open the Designer page.

pawit_roy_55-1727894921408.png

2. Click pawit_roy_56-1727894921147.png to create a new pipeline.

 

pawit_roy_57-1727894921323.jpeg

3. Change the label to “Employees training” and click save.

pawit_roy_58-1727894921349.png

4. At this step, we already have a new empty pipeline.

pawit_roy_59-1727894921365.png

Then, find the “JSON Generator” snap from the side panel and drag it to the canvas screen. This snap generates a JSON document for the next snap in the pipeline. We will set it as an input source.

pawit_roy_60-1727894921550.png

5. Click at the JSON Generator snap to open the configuration dialog and click “Edit JSON.”

pawit_roy_61-1727894921323.png

Then, replace all JSON with the value below.

[
    {
        "Name": "Albert Maro",
        "Location": "Field",
        "Extension": 4357,
        "Email": "amaro@company.com",
        "Title": "Director, Eastern US",
        "Department": "Sales",
        "Dept ID": 1100
    },
    {
        "Name": "Anthony Dunn",
        "Location": "HQ",
        "Extension": 4387,
        "Email": "adunn@company.com",
        "Title": "Social Media Director",
        "Department": "Marketing",
        "Dept ID": 1200
    },
    {
        "Name": "Rich Harris",
        "Location": "CO",
        "Extension": 4368,
        "Email": "rharris@company.com",
        "Title": "Principal Developer",
        "Department": "Engineering",
        "Dept ID": 1300
    }
    // more data
]

pawit_roy_62-1727894921698.png

Click “Ok” and save button (pawit_roy_63-1727894921058.png) before close the dialog.

6. Wait for the validation to finish. If it doesn’t run validation, click the validation button to manually validate the pipeline.

pawit_roy_64-1727894921368.png

7. Find the “Mapper” snap and drag it to after the JSON generator. The Mapper snap transforms incoming data with the specific mappings and produces new output data.

pawit_roy_65-1727894921221.png

8. Click on the Mapper snap to open the configuration dialog.

pawit_roy_66-1727894921601.png

We focus on the five blocks at the bottom of the dialog.

  • Input Schema - shows the schema of input data
  • Mapping table - is the configuration to map from input data to new output data
  • Target Schema -shows the schema of output data. But this snap hasn’t been validated yet, so it shows nothing.
  • Input Preview - shows the current input data
  • Output Preview - shows the current output data

Next, set the mapping table with the information below.  To add multiple mapping, click pawit_roy_67-1727894921060.png in the top right corner.

Expression

Target path

$Name.split(' ')[0]

$Firstname

$Name.split(' ')[1]

$Lastname

$Email

$Email

$Title

$Title

$Location == "HQ" && $Department == "Marketing"

$Trainging

The finish configuration will look like this.

pawit_roy_68-1727894921348.png

Click save and close the dialog.

9. Click the preview button after the Mapper snap. The output should be like this.

pawit_roy_69-1727894921371.png

SnapGPT

SnapGPT is an interactive tool inside SnapLogic Designer. It uses the power of LLMs to democratize integration by helping users create and manage integrations using natural language prompts. The SnapGPT can do six main functions in SnapLogic.

  1. Generate pipelines
  2. Describe pipelines
  3. Analyze pipelines
  4. Ask anything about the SnapLogic Intelligent Integration Platform (IIP)
  5. Generate SnapLogic expressions
  6. Create SQL queries

Usage SnapGPT

pawit_roy_0-1727895781931.png

You can open the SnapGPT panel by clicking on the SnapGPT logo in the header bar. Then, the panel will be displayed with a welcome message.

pawit_roy_1-1727895782168.png

Next, we will show how to use each feature of SnapGPT on the SnapLogic platform.

Generate pipelines

Prompt direct to the SnapGPT

Example prompts:

  • Extract opportunity object records from Salesforce and add them to Snowflake
  • Create a Pipeline using Salesforce Read to fetch my Opportunities, Filter out any opportunities outside of the last fiscal quarter, then write them to Snowflake.
  • Extract opportunity object records from Salesforce closed before “2022-10-01” and add them to Snowflake.
  • Create a pipeline that fetches my SnapLogic Activity Logs from the SnapLogic API.

Describe pipelines

Open the pipeline you want to describe, then go to the SnapGPT panel and ask, “Describe the pipeline.”

Example prompts:

  • Describe the pipeline

Analyze pipelines

Open the pipeline you want to analyze, then go to the SnapGPT panel and ask, “Analyze the pipeline.”

Example prompts:

  • Analyze the pipeline

Result:

SnapGPT identifies issues with the pipeline and makes suggestions for improvement, and Snaps in the pipeline offers suggestions.

pawit_roy_2-1727895782143.png

pawit_roy_3-1727895782085.png

Ask anything about the SnapLogic Intelligent Integration Platform (IIP)

Example prompts:

  • How do I build a pipeline?
  • When and how should I use the Salesforce SOQL snap?
  • How can one pipeline call another pipeline?
  • Can pipelines use recursion?
  • How is an Ultra pipeline different from a regular pipeline?

 

Generate SnapLogic expressions

To begin, simply open a snap and select the pawit_roy_4-1727895781635.png icon. This action activates the expression generation feature, enabling me to assist you in creating expressions. I can start creating expressions for you either in our chat or inside the expression-enabled field itself by typing the prompt and then clicking on the SnapGPT icon pawit_roy_5-1727895781635.png.

Example prompts:

  • Generate an expression to filter my closed lost opportunities.
  • Generate an expression to grab the current date and time.

Create SQL queries

Open a Snap that supports SQL or SOQL queries and open SnapGPT.

For example, if you open the Salesforce SOQL Snap, the suggestion Create SQL query appears above the SnapGPT prompt. SnapGPT generates the query and displays it in the SQL Preview panel. You can review the generated SQL before applying to the snap.

pawit_roy_6-1727895781611.png

Example prompt:

  • Generate a SQL query to get the total amount of opportunities closed within the last quarter grouped by the account's country and deal status.

 

0 REPLIES 0