CSV Generator

Overview

You can use this Snap to generate a new CSV document for the next Snap in the pipeline.


Overview

Important:

Variables in the CSV, such as $name or $email are the variables that are retrieved through the input view of the Snap during execution. You can map these variables by using an upstream Data or Structure Snap.

Prerequisites

None.

Snap views

View Description Examples of upstream and downstream Snaps
Input Any document that contains data structured as key-value attributes.

Format: Document

Output CSV data formatted using specifications provided in the Snap's settings.

Format: Document

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: CSV Generator

Example: CSV_Generator_temp
Edit CSV Button
Click the button to launch the CSV editor to define a CSV document. The editor loads an existing CSV document if you have defined it earlier. You can save the CSV file in SnapLogic's file system or import an existing CSV document from it.
Important: Ensure that the CSV document header contains non-empty values for all columns.

Learn more about editing CSV document.

You can customize the CSV:
  • To generate static content that produces one output document.
  • To set variables in the CSV that can be substituted with document values from the input view of the Snap.
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: Validate and Execute

Example: Execute only

Editing CSV document

  1. Click Edit CSV to launch the CSV Editor.
  2. Edit the CSV file as required.
  3. Click Ok.

    The JSON document is stored in the Snap.

Options in CSV Editor

The following table describes the numbered callouts in the image:
Callout Number Option Description
1 Hide whitespace Hides the whitespace in the output that you may have in the CSV input document.
3 Export Export the JSON document to SnapLogic's file system (SLFS)
4 Import Import a JSON document from your local directory or SLFS.