inicianteInício fácil

Join

This documentation explains the Join rule flow, which demonstrates how to merge multiple arrays within a workflow based on a common key.

DecisionRules

David Škarka

Template author

The primary objective of this flow is to demonstrate the usage of the Join node. It combines two or more arrays by matching a specific key within the objects of those arrays. In this example, the flow merges a list of names with a list of ages to create a single dataset.

Solution Components
1. Global Variables: The flow initializes two arrays defined as global variables that serve as the input for the join operation:
  • array1: Contains objects with id and name (e.g., John, Alice).
  • array2: Contains objects with id and age.
2. The Execution Engine: The workflow sequences the logic using the following nodes:
  • START node: The entry point that triggers the execution of the flow.
  • arrayJoin node: This is the functional core of the flow.
    • Input Paths: References globalVariable.array1 and globalVariable.array2.
    • Join Key: Uses the "id" field as the common identifier to match records across arrays.
    • Target: Outputs the merged result to output.joinedArray.
  • end node: Finalizes the process and returns the joined array.

Logic & Handling
The Join node processes the data as follows:
  • Matching Keys: When an id matches in both arrays, the properties (name and age) are combined into a single object.
  • Unmatched Keys: If a key exists in one array but not the other (e.g., an id for age that doesn't match a person), a new object is still created in the resulting array containing only the available data.
Check iconA checkmark inside a circle signifying "yes"Minus iconA minus inside a circle signifying "no"PROS IconA plus symbol representing positive aspects or benefits.CONS IconA minus symbol representing negative aspects or drawbacks.

More Templates

See Other Templates

serviços financeirossugerido

Teste A/B

Descubra uma maneira simples de atribuir um grupo de teste para realizar testes A/B em suas decisões.

Explore
serviços financeirossugerido

Precificação baseada em risco

Descubra uma maneira simples de aplicar uma matriz de precificação baseada em risco adequada ao tipo de cliente.

Explore
serviços financeirossugerido

Critérios de Elegibilidade e Regras da Política

Descubra uma maneira simples de definir e executar vários conjuntos de regras e obter o resultado da decisão final.

Explore