I am reading 3 array variables from 3 diff files and want to add all three variable into mail? Requesting help?

For e.g.
orderID(array)
InvoidID(array)
Error(array)

it will look like this in mail
orderID 1:
invoiceID 1:
Error1:

orderID2:
invoiceID2:
Error2:

HI @anjasing ,

If All the array size is same then do loop and make an format.

Regaards,
Arivu

If you can elaborate more…all the arrays are of same size…I have to send the format in single mail

Hi

Hope these steps would help you resolve this

—say you have three array variables named arr1, arr2 and arr3
—first create a assign activity like this
Str_input = string.Empty
And another assign activity like this
Str_output = string.Empty

—and one more assign activity with int type like this
counter = 1

—now use a while activity and mention the condition as
counter <= arr1.Count

—now mention like this with another assign activity
Str_input = “OrderID ”+counter.ToString+”:”+arr1(counter-1).ToString+Environment.Newline+“InvoiceID”+ counter.ToString+”:”+arr2(counter-1).ToString+Environment.Newline+“Error”+ counter.ToString+”:”+arr3(counter-1).ToString+Environment.Newline+Environment.Newline

—inside the same loop next to the above assign activity use a assign activity like this
str_output = stroutput + str_input

—and another assign activity like this
counter = counter + 1

Now outside the loop use a mail activity and use that str_output as mailbody

Cheers @anjasing

@anjasing
Classical with for each:


grafik
Using arr1,2,3 as shown below

For reducing the effort of the different counters and access indexes we can do following:


grafik

For exploring purpose, but not making it more compact we do have the zip function from LINQ