When dealing with an object containing an array property or a simple array and the need arises to iterate through each element for individual processing, you can use the 'For Each' node to run your operations.
How to Setup?
Configuring 'For Each Node: Input Specifications
The name of the object property or array name must be entered in the 'Loop through object' field.
Access each item in the array using the 'Current Item' property.
- The 'Inject' node is used to initialize the flow.
- Use the 'Function' node to create the array.
msg.arr = ["https://forum.uipath.com/t/new-for-each/480760", "https://www.robomotion.io/", "https://explore.robomotion.io/"];
The 'Open Browser' node is used to open alternative browsers. Use the 'Open Browser' node before the 'For Each' node because you should not open a new browser for each array element.
The 'For Each' node is used to go through each element in the array using 'Go To' and 'Label' nodes.
The 'Open Link' node is used to open the defined link from 'Input-URL'. Map the 'Go To' node to the 'Label' node. When the 'Go To' node's turn comes, the flow continues with the 'Label' node.
The 'Close Browser' node is used to shut down the browsers.
Stop the flow by using the 'Stop' node.
Here you can access the complete flow by clicking on the following link: