Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this articleIn this Article

Table of Contents
maxLevel2
absoluteUrltrue

Overview

You can use Use this Snap to  consolidate all documents from upstream Snaps consolidate multiple input streams into a single output document. Based on the Snap's configuration, , where each input stream displays the count of documents, all records, first record or the final record.

...

is displayed as a a label containing the records that were received by that input view.

It is also important to note that this Snap does not complete executing until the execution of all upstream Snaps is done.

Image RemovedImage Added650

Note

Unless the Ignore empty stream checkbox is selected, the Gate Snap always produces an output document, regardless of how many or if no input documents are received. In some Pipeline designs, this functionality can trigger an error message stating, mapped variables are missing, during validation. This error typically occurs when a downstream Snap expects a field based off an output document from the Gate Snap that is empty.

To prevent the error from occurring, you can limit empty documents produced by the Gate Snap by inserting a Filter Snap after it with the following expression in the Filter Expression
required
field:

!$.isEmpty()

When you run the Pipeline after adding the Filter Snap with this expression, the Pipeline validates and executes successfully, and the error no longer occurs.

Prerequisites

...

Prerequisites

This Snap collects multiple input documents into a single output document; hence there are system memory limitations, and it should not be used for massive data propagation. If large amounts of data are required, offload your data before Snap execution. You can also write your data to a file or database; then, after Snap execution completes, you can use a Reader Snap (such as File Reader and , S3 Reader, and so on) to read from the offloaded data source.

Support for Ultra Pipelines

Does not support Ultra Pipelines.

Limitations

This Snap does not have error views. If the Snap fails during validation or execution, documents are not passed through, and you receive an error message. 

...

Snap Input and Output

...

Support for Ultra Pipelines

Does not support Ultra Pipelines.

Snap Views

TypeFormatNumber of ViewsExamples of Compatible Upstream and Downstream SnapsDescription
Input Document
  • Min: 1
  • Max: ∞
  • Mapper
  • JSON Parser
  • Join
One or more documents containing records that must be passed on to downstream Snaps for further processing.
OutputDocument
  • Min: 1
  • Max: 1
  • Copy
  • Join
  • Common Words

A single document that contains all the records received from the various upstream Snaps.

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:

  • Stop Pipeline Execution: Stops the current pipeline execution if the Snap encounters an error.

  • 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

Info
  • Asterisk ( * ): Indicates a mandatory field.

  • Suggestion icon (Image Added): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon (Image Added ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ( Image Added ): Indicates that you can add fields in the field set.

  • Remove icon ( Image Added): Indicates that you can remove fields from the field set.


Field NameField TypeDescription

Label*


Default Value
: Gate
ExampleEnsure Complete Execution

String
Specify a
The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your
Pipeline
pipeline.

Ignore Empty Stream


Default Value:

Gate

Deselected
Example: Ensure Complete Execution

Ignore empty stream
Checkbox

Select this checkbox

to enable the Snap to ignore empty streams received at the input view during Pipeline execution. In such a case, the Snap does not

if you do not want this Snap to produce any output document

; else

.

When you deselect this checkbox, the Snap writes an empty

array

document to the output

document

view.

Output Document Content*


Default Value:

DeselectedOutput Document Content

All input documents
Example:

N/A

Document count and first document for each input

Dropdown list

Choose

an option to indicate the document count and the specific document to include in the output. This option helps avoid excessive memory consumption. The available options are:All input documents: Waits for all the input documents to include in the output.

one of the following options to determine the content of the output document:

  • All inputs documents
  • Document count and first document for each input:
 Includes document count and the first document from each input in the output. If an input has no documents, the output is displayed as null
  •  
for the first document from that input.
  • Document count and final document for
each input: Includes document count and the final document from
  • each input
in the output. If an input has no documents, the output is displayed as null for the final document from that input.
Info

Using All input documents option can consume a lot of memory. If your use case does not require all of this data, consider using other options for Output Document Content, which are less memory intensive.

For more information, see this example.



Snap Execution


Default Value
:

 All input documents

Validate & Execute
Example
:

 Document count and first document for each inputSnap ExecutionN/A

Execute only

Dropdown list

Select one of the following 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
  • pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during

Pipeline
  • pipeline runtime.

  • Execute only: Performs full execution of the Snap during

Pipeline
  • pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default Value: Validate & Execute
Example: Execute only

Examples

Combining Completed Upstream Execution Output Using the Gate Snap

This example demonstrates how you can use the Gate Snap to combine the complete output of multiple upstream Snaps into a single document. This example also shows how the Gate Snap does not doesn't offer any output until all upstream Snaps have completed executingare executed.

Download this Pipeline

Understanding the Pipeline

  1. You add a Configure the File Reader Snap to the Pipeline pipeline and configure it to read a CSV file containing contact information:


  2. You add Configure a CSV Parser Snap to read the input binary data as CSV. Once this Snap validatesexecutes, you can view the contents of the file that the File Reader Snap read:


  3. You create a separate branch of the Pipeline by adding an unconnected REST Get Snap. You configure the Snap to retrieve contact data from HubSpot, which typically offers data in pages of 20 records each. You use the Has next and Next URL fields to specify how the Snap can retrieve additional pages of data. For step-by-step information on how to use the REST Get Snap to perform this task, see Retrieving Contact Information from HubSpot.


    The REST Get Snap retrieves the data in pages of 20 as requested until the value of the has-more variable changes to false:

    Info

    Note that until the REST Snap completes executing, the Gate Snap doesn't start reading data from any of its input views.



  4. You create another branch of the Pipeline by adding a JSON Generator Snap that provides customer information:


  5. You add a Gate Snap and configure it to have three input views:

    You make
    Make no further changes to the Gate Snap and connect its three inputs to each of the branches branch you created in the steps above.

  6. You save Save and run the Pipeline. The Gate Snap now collects the completed inputs from all upstream branches and offers them all as separate arrays in a single output document:


  7. To check how the Gate Snap behaves when one of the Snaps does not offer any output, you introduce an error into the REST Get Snap:


  8. You now save Save and re-execute the Pipeline. The Gate Snap now offers an output which that contains all the data received from the File Reader and JSON Generator branches; , but in the output associated with the REST Get Snap, it outputs a null record:

Download this Pipeline.

Collecting the Output Document Content

This example Pipeline demonstrates the following three methods in which to collect the output document content from the upstream Snaps using the Gate Snap.

  • All input documents
  • Document count and first document for each input

  • Document count and final document for each input

Image Removed

We build three Pipelines to pass data using two Mapper Snaps and empty data from the JSON Generator Snap.

Image Removed

...

We connect the Gate Snap to the upstream Snaps. We configure the Gate Snap in each Pipeline with each of the options under Output Document Content field as highlighted in the screenshots below. Upon validation, the Snaps yield the respective outputs based on the configuration.

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

...

Image Removed

Download this Pipeline.

Downloads

Attachments
patterns*.slp, *.zip

...

Related Content

...