Skip to main content

JSON Generator

The JSON Generator serializes data in a field to a JSON-encoded string. You can serialize data from List, Map, or List-Map fields.

When you configure the processor, you select the field that you want to convert and the field to write the JSON string data to.

If the target field exists, the JSON Generator overwrites the data in the field. If the data does not exist, the JSON Generator creates the field.

Configuring a JSON Generator

Configure a JSON Generator to serialize data in a field to JSON data in a string field.

  1. In the Properties panel, on the General tab, configure the following properties:

    General PropertyDescription
    NameStage name.
    DescriptionOptional description.
    Required FieldsFields that must include data for the record to be passed into the stage.

    Tip: You might include fields that the stage uses.

    Records that do not include all required fields are processed based on the error handling configured for the pipeline.
    PreconditionsConditions that must evaluate to TRUE to allow a record to enter the stage for processing. Click Add to create additional preconditions.

    Records that do not meet all preconditions are processed based on the error handling configured for the stage.
    On Record ErrorError record handling for the stage:

    _ Discard - Discards the record.
    _ Send to Error - Sends the record to the pipeline for error handling.
    * Stop Pipeline - Stops the pipeline. Not valid for cluster pipelines.
  2. On the Parse tab, configure the following properties:

    JSON Generator PropertyDescription
    Field to SerializeThe field that contains the data to process. Select a List, Map, or List-Map field.
    Target FieldThe field to write the resulting JSON data to.

    If you specify an existing field, the existing data is overwritten. If you specify a new field, the processor creates the field.