Use the For Each component

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 1 minute to read
  • Traverse each item in a collection in the order of first to last using the For Each component in the RPA Desktop Design Studio. The collection can be an array, list, or a table.

    Before you begin

    Role required: none

    About this task

    You can configure the properties for the For Each component.
    Table 1. Properties of the For Each component
    Property Description
    Delay After Execution The number of seconds to pause after running.
    Delay Before Execution The number of seconds to pause before running.
    Delay for each execution (Seconds) Specified delay before an item in the object, array, or a list is executed.
    Enable Timeout Select to apply a timeout value.
    Timeout The number of seconds at which the operation will time out if it is not completed. To apply this value, the Enable Timeout property must be set.

    Procedure

    1. In the Toolbox pane, navigate to Loops > For Each.
    2. Drag the For Each component to the Design surface.
    3. To configure the input fields, see Configure port properties.
    4. Connect the data and control ports of the For Each component to the corresponding ports of the other components as described in the following table.
      Port type Port name Data type Purpose of connection Default value Mandatory?
      Data In Collection Object Takes the collection as an input. No default value Yes
      Data Out Current Object Object Returns each item from the collection. Not applicable Not applicable
    5. Optional: To test the component, under the DESIGN tab, click Run.