Parallel For Each

Hi Team,

Can you please explain the parallel for each loop use in a workflow.

Thanks & Regards,
Priya

1 Like

Probably this will shed some light

3 Likes

Example For Parallel For Each activity…
In this workflow,the Parallel for each type can be only accepted by System.Collection.Generic.iEnumerable(Integer) data type value…
I declare a variable like new_array contains value of {1,2,3,4}
After executing in parallel For each It will Display like {4,3,2,1}

Parallel.xaml (13.5 KB)

Regards,
Poovarasan Guna

1 Like

Another example of parallel for each, using monitor events for dynamic images
Use Case - Images loaded from a folder, monitor every image for click

For Each - Only the last image in the array will be monitored
Parallel For Each - Every image in the array will be monitored

Note: Ensure you use UIAautomation.Activities 19.3 or above

ParallelForEach.zip (120.4 KB)

7 Likes

Thanks…!

great answer it works :slight_smile: very useful info.

Hi Deeksha_Bhat
Unable to open our .xaml File…I am facing the below issue…

Hi Deeksha_Bhat
Please can you reply and help me out to solve the issue…

Can you open other projects normally?
That error usually appears when your Studio gets automatically updated and your robot doesn’t. Have you tried restarting your computer to see if the updates get synchronized?

Hi Mateus_Cruz

I was not able to open the .xaml files that i have downloaded from online…remaining files i was able to open

Hey, I am trying to use Parallel for each file type in a directory. I am using a long running workflow and hence creating queues in Orchestrator. I need to use the name of file as Queue reference. How do i provide the file name as reference as we know that variables which has broader scope do not work properly? When assigning the name of file to a variable, outside the parallel for each activithy only fetches the first file name it processed.