How to loop through two arrays at the same time and send email

Hi All,

I have two array to loop through , arrFilesPDF, arrFilesXML.

I need to send one mail per two attachments of both arrays for each item.

when I am looping through arrFilesPDF using for each , while processing the first item of Arr1 I need to use the first item of arrFilesXML that means I need to loop through it too.

So for first item of arrFilesPDF, I need first item of arrFilesXML and send the mail. Hence I need to loop through both the arrays at the same item. How Loop through arrFilesXML inside arrFilesPDFso that I only get first item of arrFilesXML for first item of arrFilesPDF?

The workflow now is sending 6 mails instead of 3, because there are 3 files per folder.

like this second item of array2 for second item of array1

Please help

mail12q.xaml (15.0 KB)

Hi @yourubl

You can try this logic

Attachment sections

U can try this logic

Mark it as solution if it resolves your query

Nived N
Happy Automation

Hi Nived, thank you for your response! This worked well when giving arrFilesPDF(i) in attachment! Thank you and have a nice day!

do you have an idea how to sort the values in the array based on last modified date?


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.