This example demonstrates how, effective 4.20 Patch transform8670 and
onwards, you can use the JSON Formatter Snap to filter the input JSON data.
-
Generate a JSON document using the JSON Generator Snap.
-
In the Mapper Snap, map the input fields:
interface_id
,
failed_pipeline
, target_url
, and
payload
to the required output fields.
-
In the JSON Formatter Snap, in the Content field under Settings, select
$payload
as the object to be included in the output.
-
Select the JSON lines checkbox to ensure each record appears as
a separate line in the output file.
-
Provide the name of the file to write to in the File Writer Snap and save it.
-
Validate and execute the pipeline. With Patch transform8670 onwards, the JSON Formatter
Snap correctly acknowledges the Content field, irrespective of the
JSON lines checkbox selection. So, in this example, the output
would contain only the specified object’s data (
$payload
):
Prior to Patch transform8670, the JSON Formatter Snap would ignore the value in the
Content field and write the entire input data to the output file
if the JSON lines check box was selected, as shown in the image
below:
To reuse the pipeline:
- Download and import the pipeline into SnapLogic.
- Configure Snap accounts as applicable.
- Provide pipeline parameters as applicable.