principianteInicio 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.
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
idandname(e.g., John, Alice). - array2: Contains objects with
idandage.
- 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.
More Templates
See Other Templates
servicios financierossugerido
Pruebas A/B
Descubra una forma sencilla de asignar un grupo de prueba para realizar pruebas A/B en sus decisiones.
servicios financierossugerido
Precios basados en el riesgo
Descubra una forma sencilla de aplicar una matriz de precios basada en riesgo adecuada en función del tipo de cliente.
servicios financierossugerido
Normas de elegibilidad y política
Descubra una forma sencilla de definir y ejecutar varios conjuntos de reglas y obtener el resultado de la decisión final.