Pivot

Overview

You can use this Snap to convert selected columns in the input document to the rows in the output document.



Snap views

View Description Examples of upstream and downstream Snaps
Input Documents with nested or flat map data.
Output Stream of documents with pivoted map data and the pivoted fields.
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 an error occurs.
  • 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.

Snap settings

Legend:
  • Expression icon (): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: Pivot

Example: Pivot contract emps
Selected Fields Use this fieldset to select fields to be pivoted or remain unchanged in the output document based on the value of the Treat selected fields as static checkbox.
Selected Field String/Expression Specify or select the field to be included in the action.
root/folder1/subfolder1/line.shp

Default value: N/A

Example: $StudentName
If Field Absent Dropdown list Select one of the following options to apply for the selected field:
  • Ignore
  • Substitute null
  • Substitute empty string
  • Substitute zero

Default value: N/A

Example: $StudentName
Treat selected fields as static Checkbox Select this checkbox to treat selected fields as static in the output document.

Selecting this checkbox enables the following fields:

  • No Pivots Target Field Behavior
  • No Pivots Target Value Behavior
Note: Selecting this checkbox affects the processing of the input documents and preserves the structure of the selected fields when the remaining fields are pivoted.
Default value: Deselected
Target Pivoted Field String Required.

Specify or select the target pivoted field.

Default value: N/A Example: $Student
Target Pivoted Value String Required. Specify or select the target pivoted value. Default value: N/A Example: Score
No Pivots Target Field Behavior Dropdown list Required.

Appears when you select the Treat selected fields as static checkbox.

Select one of the following options (behavior) you want to apply on the target fields—by default if no fields remain to be pivoted (all fields selected as static):

  • Ignore
  • Substitute null
  • Substitute empty string
  • Substitute zero
Default value: Substitute null Example: Ignore
No Pivots Target Value Behavior Dropdown list Required.

Appears when you select the Treat selected fields as static checkbox.

Select one of the following options (behavior) you want to apply on the target fields—by default if no fields remain to be pivoted (all fields selected as static):

  • Ignore
  • Substitute null
  • Substitute empty string
  • Substitute zero

Default value: Substitute null

Example: Ignore

Target field full path Checkbox Appears when you deselect the Treat selected fields as static checkbox. Select this checkbox to include the target field as a full path when the Pivot field property value is nested. Default value: Deselected
Snap execution Dropdown list
Choose 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.

Default value: Execute Only

Example: Validate and Execute

Troubleshooting

Error Reason Resolution
If a Selected Field has a space in the name, an error is displayed and the Snap fails. The Selected field does not support empty spaces. Enclose the field value in braces and single quotes ( [' ']). For example, $['House Rent'] instead of $House Rent.
Invalid default behavior for pivoted target field and target value. Behavior for one of the Target field or Target value fields cannot be Ignore when the other is not Ignore, and there are no fields available to pivot Select Ignore behavior or non-Ignore behavior for both target field and target value and retry