Can anyone help in writing arrays into mailbody of outlook?

Say for example you have 10 errors and 10 messages and at times we may not know the number of error or other values we have

So hope the below steps would help you resolve this

  1. Use a Assign activity and mention like this

str_top = “

Hi Team,

Please refer below information for your reference:

  1. Now create a temp string variable named str_temp in variable panel

  2. Then use a FOR EACH activity where pass you array variable having the value of orders and change the type argument as string

Inside the loop use a assign activity like this

str_temp = “

“+”Order “+(Array.IndexOf(arrayvariable,item)+1).ToString+item.ToString+”

And another assign activity like this

str_top = str_top+str_temp

  1. Now this loop will
    Keep on writing till last order value and also the HTML code

  2. outside to the above loop use a assign activity and mention like this

str_final = str_top + “<:/br>”

  1. Similarly use another FOR EACH Activity and pass the array variable for errors and change the type argument as string

  2. Same as above inside the loop use a assign activity like this

str_temp = “

“+”Errors “+(Array.IndexOf(arrayvariable,item)+1).ToString+item.ToString+”

  1. Same as above step
    str_final = str_final +str_temp

Hope this would help you handle dynamic number of values to place in array

Cheers @anjasing

1 Like