Skip to content
Doppelganger logo

Understanding the Merge Block

The Merge block combines multiple data sources into a single variable so you can work with them as one unified dataset. It’s used when data is produced by different blocks and needs to be processed together.


What the Merge Block Does#

The Merge block:

  • Accepts multiple data sources
  • Combines them in the order provided
  • Outputs a single merged result
  • Allows immediate follow-up logic or transformations

This keeps workflows simple and avoids duplicated logic.


Field: Description Sources#

Type: String (comma-separated list)
Required: Yes

This field defines where the data should come from.


Accepted Sources#

1. Local Variables

Variables defined earlier in the workflow.

Examples:

  • items
  • extraItems
  • results
  • tempData

2. Global Variable

Only one global variable is supported:

  • {$block.output}

This represents the output of the previous block and can be merged directly with local variables.


Example Description Sources Value#

items, extraItems, {$block.output}

This merges:

  • a local variable (items)
  • another local variable (extraItems)
  • the output of the previous block

Field: Target Variable (Optional)#

Type: String
Required: No

Defines the name of the new variable that will store the merged result.

Example:

  • allItems

If not provided, the merged result must be consumed immediately by the next block.

Best practice: Always set a target variable for clarity and reuse.


Action Sequence (Chaining Logic)#

After the Merge block runs, you can immediately append logic such as:

  • FormCSV
  • JavaScript
  • Looping
  • Conditional logic

Example flow: Merge → Filter → Transform → Save

This allows you to treat multiple data sources as a single continuous stream.


When to Use the Merge Block#

Use the Merge block when:

  • Data comes from multiple blocks
  • You need to unify local data with previous block output
  • Downstream logic requires a single variable
  • You want cleaner, more readable workflows

Summary#

The Merge block is a unification step. It merges local variables and the previous block output into one predictable structure that downstream blocks can reliably operate on.