Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: PSWAT-614

In this article

Table of Contents
maxLevel4
minLevel1
absoluteUrltrue
excludeOlder Versions|Additional Resources|Related Links|Related Information

...

Passing Binary Data

  • You can convert binary data to document data by adding the Binary-to-Document Snap upstream of the Mapper Snap. Similarly, to convert the document output of the Mapper Snap to binary data, add the Document-to-Binary Snap downstream of the Mapper Snap.

  • You can also transform binary data to document data within the Mapper Snap itself by using the $content expression. 

Binary Input and Output

  • If you are only working with a binary stream as both input and output, you must set both source and target fields with $content, then manipulate the binary data using the Expression Builder. If you do not specify this mapping, then the binary stream from the binary input document is passed through without any change.

Snap Type

The Mapper Snap is a Transform-type Snap that transforms data and passes it to the downstream Snap.

...

Works in Ultra Pipelines.

...

Limitations

  • The Mapper Snap does not support Base64URL decoding.

  • Expressions used in this Snap, downstream of any Snowflake Snaps, that evaluate to very large values such as EXP(900) are displayed as Infinity in the input/output previews. However, you can see the exact evaluated values in the validation previews. Learn more: Java Script Limitations in Displaying Numbers.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

  • Document

  • Binary

  • Min: 0

  • Max: 1

Binary-to-Document

This Snap can have a most one document or binary input view. If you do not specify an input view, the Snap generates a downstream flow of one row.

By default, this Snap has Document as Input Type. You can select Binary type if your input is in Binary format.

Output

  • Document

  • Binary

  • Min: 1

  • Max: 1

Any Document Snap

This Snap has exactly one document or binary output view.

By default, this Snap has Document as Output Type. You can select Binary type to view the output in Binary format.

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 when 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 remaining 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.

...

If the Escape Character is 

Use Expression

Sample Output 

Single quote (') 

JSON:

$original.mapValues((value,key)=> value.toString().replaceAll("'","''"))

OR

$original.mapValues((value,key)=> value.toString().replaceAll("'","\''"))

CSV:

$[' Business-Name'].replace ("'","''")

Ampersand (&)


JSON:

$original.mapValues((value,key)=> value.toString().replaceAll("'","\&'"))

OR

$original.mapValues((value,key)=> value.toString().replaceAll("'","&'"))

CSV:

$[' Business-Name'].replace ("'","&'")

Backslash (\)




JSON:

$original.mapValues((value,key)=> value.toString().replaceAll("'","\\'"))

Info

Backslash is configured as an escape character in SnapLogic. Therefore, it must itself be escaped to be displayed as text. 

CSV:

$[' Business-Name'].replace ("'","\\'")

In this way, you can customize the data to be passed on to downstream Snaps using the Expression field in the Mapper Snap. 

...

Insert excerpt
Transform Snap Pack
Transform Snap Pack
nopaneltrue