Add Headers of Data Table in HTML Editor Send Email Activity (Adding DataTable in Email Body)

Hi All,

I am using a HTML Editor where I am trying to add my DataTable but I am not getting the headers of the Data Table .In my email body I am getting the row values without header.Since I already have Data Table, In HTML Editor I am selecting option Add Data Table.
How to include the header as well as the row values in HTML Editor.

Below is the screenshot which I received in Email where I am getting only rows without headers.But I want to include Headers also.




First you can use the below marketplace activity :-

Using this it will convert your datatable to an html string which can be replaced with the {{table}} string. [ HtmlContent.Replace(“{{table}}”,dataTable_HtmlString)]

Hey @marina.dutta

The Datatable that you want to add in mail, just write it in an excel first and then read it again (uncheck add header) and add in mail using create html content.

It works perfectly

@Vikas_M

I want the headers. Now I am not getting headers.

@marina.dutta
While writing the data table to Excel u have to check the add headers property
And while reading it from excel uncheck add headers, and check the Preserve Format Property
And then pass that DT variable to HTML content , You will get headers in your output


bELOW IS THE OUTPUT

Note: Dont forget to Map the New DT in your HTML content

Happy Automation!

1 Like

@Vikas_M

Here one more thing .While building the Data Table I am using only headers. I am using Add row activity so that Dynamically the values are added to the Data Table. In Add Row Activity which Data Table value should I use , the DataTable of Read Range Workbook?

@marina.dutta
Use build dataTable output variable and Add rows to that Datatable

Let me brief you about the flow

  1. Build DT(Eg:DT1)
  2. Add rows to the DT1
  3. Once your process state is finished , then in the end process state write DT1 to an excel (Add Headers should be checked)
    4.Read the same Excel and store it in a new DT variable(eg:DT2)(Add headers should be unchecked)
  4. in Html content activity, Map the DT2
  5. Send Mail

@Vikas_M

I followed your steps but got this error.

image

@Vikas_M

It worked. Thanks a lot for the solution.

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