Type Converter

To detect and convert the data type of the incoming documents

Overview

This is a Transform type Snap that is used to detect and convert the data type of the incoming documents. It has the ability to automatically derive the type of each value. You can also specify your preference for handling certain fields in the input document.
Shuffle Overview

Prerequisites

None.

Limitations and known issues

None.

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has exactly one input document containing data of one or more data types. Data types in the sub-levels in a nested JSON may not be detected.
Output This Snap has exactly one output document where the data types have been converted based on the Snap's settings.
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 (): JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Account configuration.
  • 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: Type Converter

Example: Strings to other types
Auto Checkbox

Select this checkbox to allow the Snap detect the data types automatically.

Default status: Selected

Fail safe upon execution Checkbox

Select this checkbox to allow the Snap to ignore the invalid data types and convert the remaining fields containing valid data types.

If you deselect this checkbox, the Snap fails if there are any field with invalid data types.

Default status: Deselected

Policy

Specify your preferences about data types of fields if the auto-mode does not work as expected.

Field String/Suggestion

Required. The field that the type has to be converted. This is a suggestible property and suggests all fields in the dataset.

Default value: None

Type Dropdown list

Required. The type of transformation to be performed on the selected column. Four options are available:

  • Integer
  • Decimal
  • String
  • Date Time

Default value: String

Format String/Expression

Only applicable for date time type, specify the format. See Simple Date Format for details and Date Functions and Properties for expression examples.

Default: None.

Example: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

Snap execution 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.

Default value: Validate & execute

Example: Execute only