beginnerEasy Start
ForEach, Append
This workflow demonstrates how to effectively use ForEach and Array Append nodes to iterate through a dataset and reconstruct or copy an array of information.
David Škarka
Template author
The primary objective of this flow is to demonstrate the iteration and collection of data within a workflow. Specifically, it takes a predefined array of exchange rates for various currencies, iterates through each record, and appends those records into a final output array. This pattern is foundational for data transformation and array processing within the system.
Solution Components
The workflow is composed of the following functional nodes:
- Variables Node (declare): Initializes the source data. In this flow, it defines the currencyRates variable, which contains an array of objects representing exchange rates for currencies like CZK, CHF, EUR, MXN, INR, and USD.
- ForEach Node (foreachCurrencyRatesArray): Acts as the loop controller. It is configured to iterate through the currencyRates array defined in the variables node.
- Array Append Node (appendCurrencyRatesArray): The primary data manipulator. For every iteration of the loop, this node takes the currentItem from the ForEach loop and appends it to the target output array (output.currencyRates).
- End Nodes (endRegular, endLoop): These define the termination points of the flow. endLoop concludes the internal loop logic after an append operation, while endRegular marks the completion of the entire workflow after the loop has finished all iterations.
- Iterate Through Arrays: Use the ForEach node to cycle through a list of objects or values stored in a variable.
- Dynamically Build Lists: Utilize the Array Append node to collect data points generated or retrieved during a loop into a single structured output.
- Map Loop Items: Reference the currentItem property of a ForEach node to access the specific data of the entry currently being processed.
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.
financial servicessuggested
Risk Based Pricing
Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.
financial servicessuggested
Eligibility and Policy Rules
Discover a simple way to define and execute various sets of rules and get the final decision outcome.