How to append data table in outlook body

Hi Team,

I have one data table , i want to append data table data to key and value in the body of outlook.

I have this below datatable:
image

Note: This data table details is not static , whatever data found in excel should append in body key and value.

Please help me anyone for this.

Input:

Email Body:

Hi Team,

Invoice Number: 12345
Invoice Date: 2024-03-25
Currency: EUR

Expected output:

Invoice Number: 12345
Invoice Date: 2024-03-25
Currency: EUR
xxx:235.23
yyy:1586.67
rrr:123

Regards,
Raja G

Hi @Raja.G

Can you try below

Sequence13.xaml (20.3 KB)

Regards,

1 Like

Hello @Raja.G

You can use the activity “Output Data Table as Text” to quickly and easy convert a dynamic datatable to text, that you can then append to your mail body.

image

Best regards,
Soren

1 Like

Hi @SorenB,

Yes its working ,but while I convert string outlook body print below,

Invoice Number: 12345
Invoice Date: 2024-03-25
Currency: EUR
xxx:235.23 yyy:1586.67 rrr:123

I want print below,

Invoice Number: 12345
Invoice Date: 2024-03-25
Currency: EUR
xxx:235.23
yyy:1586.67
rrr:123

Please help me for this.

Regards,
Raja G

Hello @Raja.G

Can you please try this on your exported string from the “Output Data Table as Text”:

str_DataTableAsText.Replace(" ",vbNewLine)

Regards,
Soren

Hi @SorenB ,

This space split it wont work because

data coming also this format as well, like
xxx kkk:235.23
yyy mmm:1586.67
rrr nnn:123

so xxx kkk this data also split

Regards,
Raja G

Hi, try this :
emailBody = “Hi Team,” + Environment.NewLine + _
“Invoice Number: 12345” + Environment.NewLine + _
“Invoice Date: 2024-03-25” + Environment.NewLine + _
“Currency: EUR” + Environment.NewLine + Environment.NewLine

For Each row in dataTable.Rows
emailBody = emailBody + row(“Description”).ToString + ": " + row(“Amount”).ToString + Environment.NewLine
Next

1 Like

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