Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

  • Min: 1

  • Max: 1

  • Mapper

  • Copy

Output

Document

  • Min: 1

  • Max: 1

  • Mapper

  • Copy

  • Aggregate

  • Conditional

  • Router

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution: Stops the current pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the rest of the records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

Info
  • Asterisk (*): Indicates a mandatory field.

  • Suggestion icon ((blue star)): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon ((blue star)): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ((blue star) ): Indicates that you can add fields in the field set.

  • Remove icon ((blue star)): Indicates that you can remove fields from the field set.

...

Field Name

Field Type

Description

Label*

Default ValueConditional
ExampleConditional_test

String

Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline.

Evaluate all

Default ValueDeselected
Example: Selected

Checkbox

Select this checkbox to evaluate all the conditions and writes all the return values to the target paths if the conditions evaluates to true.

For example, select this checkbox, and select the condition as specified below:

Conditional expression: $State == "CA"

Return value: "California"

Target path: $FullName

Conditional expression: $id == 1

Return value: "found"

Target path: $status

If the input document has the following values:

Code Block
{
    State: "CA",
    id: 1
}

then the output document displays as below:

Code Block
{
    State: "CA",
    id: 1,
    FullName: "California",
    status: "found"
}

because both conditions evaluate to true.

Null-safe access

Checkbox

Select if you want to set the target value to null in case the source path does not exist. If you do not select this checkbox, then the Snap fails if the source path does not exist, ignores the record entirely, or writes the record to the error view depending on the setting of the error view property

For example, if you set the condition as $person.phonenumbers.pop() and target as $ lastphonenumber and do not select this checkbox, then it might result in an error in case person.phonenumbers does not exist on the source data. If you select this checkbox, then this option allows to write null to lastphonenumber.

Conditional table

Use this fieldset to specify the if conditions. For example, the following if statement:

if($State == "CA") {
return "California";
} else if ($State == "NJ") {
return "New Jersey";
}

can be given as these conditions:

Condition1

Conditional expression: $State == "CA"

Return value: "California"

Target path: $FullName

Condition2

Conditional expression: $State == "NJ"

Return value: "New Jersey"

Target path: $FullName

Conditional expression*

Default Value: None.
Example$State == "CA"

String/Expression

Specify the Conditional expression in this field based on which the Snap evaluates the condition.

Return value

Default Value: None.
Example: California

String

Specify the value for the condition.

Target path

Default Value: None.
Example$FullName

String

Specify the target path to which the return value has to be written.

Default value

Default Value: None.
ExampleN/A

String

Specify the default value to assign if none of the conditions evaluate to true, else statement. For example:

else {
return "N/A";
}

Default value path

Default Value: None.
Example$FullName

String

Specify the target path to which the return value has to be written when none of the conditions evaluate to true.

 

Snap Execution

Default ValueValidate & Execute
Example: Validate & Execute Disabled

Dropdown list

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

...