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 doesn't offer any output until all upstream Snaps are executed.



Download the pipelines

Pipeline 1

Pipeline 2

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


  2. Configure a CSV Parser Snap to read the input binary data as CSV. Once this Snap executes, 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:

    Note:

    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:


  6. 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. Save and re-execute the Pipeline. The Gate Snap now offers an output 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:


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