How to map datatable values html table mail template?

before

aaa bbb ccc ddd eee
1 4 7 10 13
2 5 8 11 14
3 6 9 12 14

after

the same value after how to paste the template

Dear sir,

aaa bbb ccc ddd eee

thank you.

1 Like

Hi @domsmgtmeet22

→ Use Read Range Workbook to read that and store that in a datatable. Make sure to remove Add Headers Option. After that Use Create HTML Content to map the datatable variable in Open Editor.

For steps, please refer the below thread.

Hope it helps!!

2 Likes

Hi @domsmgtmeet22

How about the following?

DT.AsEnumerable().Take(1).CopyToDataTable()

Input:

image

Output:

Note: Uncheck Add Headers option in Read Range activity

Cheers!!

1 Like

my output header missing

1 Like

Hi @domsmgtmeet22

Did you uncheck the Add Headers option in Read Range Workbook. Check the below image for better understanding. Please uncheck the marked property.

Regards

1 Like

Hi @domsmgtmeet22, your approach is theoritically correct. But, I’ve faced the same header issue with Create HTML content activity while sending a table in mail body. Here is the work around I did to fix.

  1. Once you have the datatable that needs to be sent in mail (Ex: dt1)
  2. Write it to a excel sheet using write range activity (Enable “Add Headers”)
  3. In very next step, do a Read range (Disable “Add Headers”) and store it in a different variable “dt2”
  4. Now, pass this dt2 in your Create HTML content activity and try sending it in the mail body.

Attaching xaml for your reference

createHtmlContent.zip (9.3 KB)

Best,
Aswin Sridhar

1 Like

Hi @domsmgtmeet22

Input:
image

Output:

Workflow:

Make sure to remove Add Headers option in Read Range Workbook and tick Mark IsBodyHTML in Send Outlook Mail Message.

Create HTML Content.zip (46.6 KB)

Hope it helps!!

1 Like