Use the For Each component
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.
| 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 | Option to set a timeout value. |
| Timeout | Number of seconds that the operation ends after if not completed. To apply this value, you must set the Enable Timeout property. |
Procedure
For Each loop component
Use a For Each loop component to automate user account provisioning. In this scenario, a robot reads an Excel file containing user account requests. Each row in the file includes information such as user name, email, role, and department. The robot processes each request by creating the user account, assigning the appropriate role, and sending a notification to the department manager.
- Use the Data Table connector to import rows from the Excel file.
- Drag a For Each component onto the design surface to iterate over the list of request records.
- Inside the loop:
- Extract fields from the current record.
- Navigate to the user management interface and fill in the details.
- Submit the form to create the user account.
- Send an email notification to the relevant department manager with the account details.