In this article
Use this Snap to transform incoming data with the specific mappings and produce new output data (binary or document). The Mapper Snap evaluates an expression and writes the result to the target path. Use the Views tab to specify error handling if an expression fails to evaluate.
Pass Binary Data
To convert binary data to document data add the Binary-to-Document Snap upstream of the Mapper Snap. Similarly, add the Document-to-Binary Snap downstream of the Mapper Snap to convert the document output to binary data.
You can also transform binary data to document data in the Mapper Snap itself with the $content
expression.
Binary Input and Output
If you only work with a binary stream as both input and output, you must set both source and target fields with $content
, then use the Expression Builder to manipulate the binary data. If you do not specify this mapping, then the binary stream from the binary input document passes through with no change.
Pass Binary Data
To convert binary data to document data add the Binary-to-Document Snap upstream of the Mapper Snap. Similarly, add the Document-to-Binary Snap downstream of the Mapper Snap to convert the document output to binary data.
You can also transform binary data to document data in the Mapper Snap itself with the $content
expression.
Binary Input and Output
If you only work with a binary stream as both input and output, you must set both source and target fields with $content
, then use the Expression Builder to manipulate the binary data. If you do not specify this mapping, then the binary stream from the binary input document passes through with no change.
The Mapper Snap is a Transform-type Snap that transforms data and passes it to the downstream Snap.
Works in Ultra Pipelines.
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)
displays as Infinity
in the input/output previews. However, the exact evaluated values are in the validation previews. Learn more: JavaScript Limitations in Displaying Numbers.
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input |
|
| Binary-to-Document | This Snap can have at 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, the Input type is Document. You can select Binary type if your input is in Binary format. By default, the Input type is Document. You can select Binary type if your input is in Binary format. |
Output |
|
| Any Document Snap | This Snap has exactly one document or binary output view. By default, the Output type is Document. You can select the Binary type to view the output in the Binary format. By default, the Output type is Document. You can select the Binary type to view the output in the Binary format. |
Error | Error handling is a generic way to handle errors without data loss or Snap execution failure. You can handle the errors that the Snap might encounter when running the pipeline with one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
|
Field Name | Field Type | Description | |||
---|---|---|---|---|---|
Label* Default Value: Mapper | String | 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. | |||
Null-safe access Default Value: Deselected | Checkbox | Select this checkbox to set the target value to null if the source path does not exist. For example, | |||
Pass through Default Value: Deselected | Checkbox | Select this checkbox so the Snap passes all the original input data into the output document with the data transformation results. If you deselect this checkbox, only the data transformation results in the mapping section appear in the output document and the input data is discarded.
| |||
Transformations* | Use this field set to configure the settings for data transformations. | ||||
Mapping Root Default Value: $ | String/Suggestion | Specify the subsection of the input data to map. Learn more: Understand the Mapping Root. | |||
Input Schema | Dropdown list | Select the input data (from the upstream Snap) that you want to transform. Drag the item you want to map and place it under the Mapping table. | |||
Sorted Default Value: Selected | Checkbox | Select this checkbox to sort the input schema and the target schema. The sort options are:
| |||
Mapping table* | Use this field set to specify the source path, expression, and target path columns used to map schema structure. The mapping table makes it easier to:
Learn more: Use the Mapping Table. | ||||
Expression* Default Value: N/A | String/Expression | Specify the function to use to transform the data. For example, combine, concatenate, or flatten. Expressions that are evaluated replace the source targets at the end of the pipeline runtime.
Learn More: Understand Expressions in SnapLogic and Use Expressions for usage guidelines.
| |||
Target path Default Value: N/A | String/Suggestion | Specify the target JSON path where the value from the evaluated expression is written. For example, after evaluation of the Target Path Recommendation
For example, you have the Expression $Emp.Emp_Personal.FirstName in one of your pipelines. You set the Target path for this expression as $FirstName. Now, if you use the expression $Emp.Emp_Personal.FirstName in a new pipeline, then Iris recommends $FirstName as one of the Target paths to help you standardize the naming standards in your org. The following shows how Iris recommends the Target path in a Mapper Snap: | |||
Snap Execution | Dropdown list | Select one of the three modes in which the Snap executes. Available options are:
|
The Input Schema of the Mapper Snap displays the input strings from the upstream Snap. On validation, the Input Preview displays the preview of the input from the upstream Snap, and the Output Preview displays the output preview that passes to the downstream Snap. The following elements are available in the input and output previews:
Number | Element | Description |
---|---|---|
1 | Expand All | Expands the objects in the Input/Output. |
2 | Collapse All | Collapses the objects in the Input/Output. |
3 | Render whitespace | When you select this checkbox, the blank spaces (leading, trailing, or in the middle of a string) in an expression field renders as symbols in the output:
When you deselect this checkbox, the Snap renders blank spaces and tabs as-is. By default, the Render whitespace checkbox is selected. |
4 | Download | Downloads the JSON file. |
Successful Mapping | ||||
---|---|---|---|---|
If your source data looks like | And your mapping looks like | Your output data will look like | ||
|
|
| ||
Unsuccessful Mapping | ||||
|
| An error displays. |
Related Content