principianteInicio fácil

Collect

Outlines the Collect workflow, which demonstrates how to transform and filter data within a decision flow. The workflow processes a complex array of currency exchange rates to isolate and collect specific values into a structured output.

DecisionRules

David Škarka

Template author

The primary objective of this rule flow is to transform data by iterating through a global variable containing exchange rate sets for multiple currencies. Specifically, it extracts the USD exchange rate for every supported currency and compiles these values into a single, unified output array named ratesUSD.

Solution Components
The workflow is composed of several functional nodes that sequence the logic for data extraction and collection:
  • Variables Node (declare): Initializes the currencyRates global variable, which contains an array of objects representing exchange rate sets for currencies like CZK, CHF, EUR, MXN, INR, and USD.
  • Loop Node (foreachCurrencyRatesArray): Iterates through each element in the currencyRates array to allow for individual processing of each currency's data.
  • Array Collect Node (collect): Acts as the transformation engine. For each item in the loop, it maps the currency and its corresponding USD rate, then appends these pairs to the final output.ratesUSD array.
  • Start & End Nodes: Define the entry point and the final exit point (endRegular) of the workflow execution.
What You Can Learn from This Template
By reviewing this rule flow, users can learn how to:
  • Iterate Through Arrays: Use the ForEach node to handle lists of data objects.
  • Data Transformation: Utilize the array Collect node to filter specific fields from a complex object and restructure them into a new format.
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

servicios financierossugerido

Pruebas A/B

Descubra una forma sencilla de asignar un grupo de prueba para realizar pruebas A/B en sus decisiones.

Explore
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.

Explore
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.

Explore