Purpose: To iterate over a collection of items (e.g., a list, array, or data set) and execute a set of activities for each item in the collection.
Functionality: The "For Each" activity implements a "foreach loop" structure. You configure it with:
Collection: The data collection to iterate over (e.g., a list of customers, a dataset of orders, a list of files).
Loop Body: The set of activities that will be executed for each item in the collection.
It provides access to the current item being processed within each iteration of the loop body, allowing you to work with individual elements of the collection.
Use Cases:
Data Processing of Collections: Processing each item in a list, array, or dataset (e.g., validating each customer record, processing each order in a list, transforming each file in a directory).
Iterating over Query Results: Looping through the results of a database query or API call to process each retrieved record.
Handling Lists of Objects: Performing actions for each object in a collection, such as sending individual emails to a list of recipients or updating each item in an inventory list.