beginnerEasy Start

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

financial servicessuggested

A/B Testing

Discover a simple way to assign a test group for performing A/B Testing on your decisions.

Explore
financial servicessuggested

Risk Based Pricing

Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.

Explore
financial servicessuggested

Eligibility and Policy Rules

Discover a simple way to define and execute various sets of rules and get the final decision outcome.

Explore