Render outputs from Group By Snaps

This example demonstrates how to render groups data from upstream Snaps such as Group By Fields Snap.

In a scenario where the JSON Formatter Snap needs to format data groups, you can enhance the Snap's output to format each group as a separate document, where each line is a member of the group.


JSON Generator Snap configuration

Download the Sample Pipeline.
  1. Configure the JSON Generator Snap to pass the raw JSON content to be formatted.

    JSON Generator Snap configuration

  2. The Group By Fields Snap is set to group the incoming data by $key with the Target field as $group.

    Group By Fields Snap configuration

  3. Notice that the incoming data is grouped by key in this output.

    Grouped data output


  4. JSON Formatter Settings

  5. When the JSON Formatter Snap received data groups, we can select the fields JSON lines and Format each document checkboxes in unison and the Snap formats the content as multiple documents – one per group (key1, key2, and key3 in this example) with one line for each element in these groups.

    Formatted output by group

To reuse the pipeline:
  1. Download and import the pipeline into SnapLogic.
  2. Configure Snap accounts as applicable.
  3. Provide pipeline parameters as applicable.