JSON Generator
Overview
- This Snap is often used at the beginning of a pipeline to create a file.
- This Snap does not need any accounts.

Read-type Snap
Works in Ultra Tasks
Prerequisites
- A valid account with the required permissions.
Limitations and known issues
None.
Snap views
View | Description | Examples of upstream and downstream Snaps |
---|---|---|
Input | This Snap can have an upstream Snap that can pass a JSON document in output view. | Mapper |
Output | This Snap generates a document that contains the expected result along with the original JSON document (when Pass through is enabled). | 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:
Learn more about Error handling in Pipelines. |
Snap settings
- Expression icon (
): Allows using 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 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.
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: JSON Generate Example: Document generate |
Edit JSON | Button | Launches the JSON editor which allows you to define JSON. The editor loads an
existing JSON document if defined previously. The editor lets you save JSON in
SnapLogic's file system or import existing JSON documents from it. You can
substitute the variables in the JSON with document values from the input view of the
Snap. Note: The JSON text is treated as an Apache Velocity template, so you can
substitute values from input documents or the pipeline parameters. The Apache
Velocity template can be used to pass dynamic values from upstream Snaps.
You can customize the JSON file to:
Learn more: |
Process Array | Checkbox | The Process array property specifies whether or not the Component should take
a root JSON array and write each element of the array as a JSON document. Default status: Selected |
Pass through | Checkbox | Use this property to pass the data in the input document through to the output
document and merge it under the key 'original'. Note: Do not select
this property if the input data is not in JSON lines format. If it has no newline
character and its data size exceeds available memory, it may cause an out of
memory error.
Default status: Selected |
Support Type Extensions | Checkbox | Select this checkbox to enable the Snap to format/parse the Snaplogic-specific syntax indicating objects of the special types, such as byte arrays and date objects in JSON. For more information, see the Input Schema Types example. |
Snap execution | Dropdown list |
Choose one of the three modes in
which the Snap executes. Available options are:
Default value: Validate & Execute Example: Execute only |
Troubleshooting
Unexpected character ('{' (code 123)
Possible Causes
The array entries in the JSON file do not follow the syntax. A comma ',' is expected before the beginning of every second array—'{'.
Possible Solutions
Verify the array at the row and column mentioned beside the error message using the Edit JSON feature and add a comma appropriately.