Fixed Width Formatter

Overview

This Snap provides fixed width formatting for the column values and writes binary data to the output view. Fixed width format for columns has data where every field will have a fixed width. For those fields values where their width is less than the specified width, they will be padded with spaces. The field width is user configurable.

Prerequisites

  • A valid account with the required permissions.

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has exactly one document input view, where it will receive the document data to be formatted into fixed width binary data. JSON Generator
Output This Snap has exactly one binary output view, where it provides a binary data stream containing the fixed width data. Group By Fields

Mapper

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: Fixed Width Formatter

Example: Fixed Width Formatter
Skip lines String/Expression Number of lines to skip at beginning of the data.

Default value: 0

Example: 2

Line separator String/Expression The character used to separate lines in the output. Enter "\n" to separate the lines with a new line character.

Default value: \n

Add header Checkbox This option specifies whether the Snap should write the field names while writing the formatted data to the output.

Default status: Selected

Field configuration Details to be filled for each field that is required in the output.
Input field String/Expression Required. Field name to be used while writing the header.

Default value: [None]

Example: First Name; Last Name

Field width String/Expression Required. Fixed width for the field. If the value for this field is less than the specified width, the value will be padded with spaces.

Default value: [None]

Example: 25

Format type Dropdown list Required. The format type to be performed on the field value when the field width is less than the specified width. The options available include:
  • [None]: Doesn't apply any formatting
  • Prefix with spaces: Pads spaces at the left side of the field value
  • Suffix with spaces: Pads spaces at the right side of the field value

Default value: None

Example: Suffix with spaces

Action Dropdown list Required. Action to be performed when the existing field value is larger than the specified width.
  • [None]: Doesn't apply any action
  • Truncate at end: Truncates data at the end of the field value to set the field width to the specified width
  • Write to error view: Writes the document to the error view without applying any action

Default value: [None]

Example: Write to error view

Null-safe access Checkbox
  • Enabled: Lets you set the target value to null in case the source path does not exist.
  • Disabled: Fails if the source path does not exist or ignores the record entirely or writes the record to the error view depending on the setting of the error view property.
Snap execution Dropdown list

Select one of the three modes in which the Snap executes.

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution 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 & Execute