Skip to main content

Sumator

Type: sumator • Category: flow • Tags: join, merge, data

Description

Join two lists of dicts by key

Parameters

NameTypeDescriptionRequiredDefault
leftExprstringExpr -> list[dict] (left) lub bezpośrednio listano
rightExprstringExpr -> list[dict] (right) lub bezpośrednio listano
keystringCommon key present in both dictsno
joinTypestringJoin typeno"inner"
conflictStrategystringConflict: prefer_left / prefer_right / rename_right (suffix _r)no"prefer_left"

Help

Join Lists of Dictionaries Worker

Merges two collections of dictionary objects based on a common key. Supports various join types and conflict resolution strategies.

How it works:

  1. Data Resolution: Evaluates expressions to get left and right lists
  2. Key Matching: Joins dictionaries based on specified key field
  3. Conflict Resolution: Handles overlapping fields according to strategy
  4. Result: Returns merged list of dictionaries

Parameters:

  • leftExpr: Expression returning left list of dictionaries
  • rightExpr: Expression returning right list of dictionaries
  • key: Common field name present in both lists
  • joinType: Type of join operation
  • conflictStrategy: How to handle field conflicts

Join Types:

  • inner: Only matching keys (intersection)
  • left: All left records, matching right records
  • right: All right records, matching left records
  • outer: All records from both lists

Conflict Strategies:

  • prefer_left: Keep left value when fields conflict
  • prefer_right: Keep right value when fields conflict
  • rename_right: Keep both, rename right field with '_r' suffix

Examples:

  • Basic join: leftExpr="data.users", rightExpr="data.profiles", key="user_id"
  • Expression join: leftExpr="vars.api_data", rightExpr="[{'id': 1, 'status': 'active'}]", key="id"

Input Format:

  • Lists of dictionaries with consistent key field
  • Key field must exist in all dictionaries
  • Values can be any type (strings, numbers, objects, arrays)

Output:

  • List of merged dictionaries
  • Count of resulting records
  • Preserves all fields from matched records

Common Use Cases:

  • Combine user data with profile information
  • Merge API responses with local data
  • Join database query results
  • Consolidate related datasets
  • Data enrichment and normalization

Notes:

  • Key field values must be hashable (strings, numbers)
  • Missing key fields in records are ignored
  • Complex nested objects are fully supported