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

2 Likes

Will it be possible for you to share the .xaml files for the solutions you mentioned above? That would be very helpful.

Zip_3ArraysTogether_LBSeperator.xaml (9.2 KB)

1 Like

Thank you so much. It helped a lot. Can you please suggest how can we incorporate this into the body of the mail for e.g.

Hi Team,

Please refer the below information for your reference.

orderID 1:
orderID2:

invoiceID 1:
invoiceID 2:

errorInfo1:
errorInfo2:

please help!
and the body is in html format

Also, in mail body it’s taking only recent value of order ID and other respective values not all

Also, if you can help in how to send that in mail format that would be really helpful.

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