How to add a header to a datatable in HTML?

Hi,

I’m extracting a datatable from a table in Edge. The data includes 1 or multiple error message(s). I would like to email the error messages to notice other people that there was en error. But, it looks like it’s handling row 1 as the header. Not a big problem if I there would be only 1 error per item processed, but sometimes it includes multiple different errors. This results in different formatting for the 2 errors (look at the image down below).

image

How do I add a header to it? So that all the others rows get the same format.

Thanks in advance!

@Youri98

how are you creating the html table?

make sure you add a header in datatable itself…one way you can do is always use a add data row activity first and add the column name as value and thenc hange the column ame to error or anything you need

add data row to dt and arrayrow as {dt.Columns(0).ColumnName}

and assign as dt.Columns(0).ColumnName = "Error"

cheers

1 Like

In the send email activity, I’m using the editor and using the ‘Add data values’ to add the datatable into the editor.

image

When creating the datatable it does have a header. See the screenshot below.

The ‘Foutomschrijving’ should be the header and the 2 rows below that should be the rows in the table in the email as well.

I thought it would be automatic to add the header (or to check/uncheck somewhere). But I can’t find where I can just add it.

we encountered a bug in the HTML template editors (e.g. Create HTML Content) where the heade line was lost. In a lot of scenarios the following workaround will serve:

  • Add a new Row at the first position and use the header names as values

UPD1 - adding a row at the first position:

@Youri98

please follow @ppr instructions

you can use invoke method with insertAt method… pass target object and in arguments pass ColumnName string {“Name”} and 0

cheers

1 Like

Thank you, I do understand the ‘Invoke Method’, but what are the other activities I need to perform? Assign?

Thank you. I used two assigns, one for the new row, one for the new column header e.g. name of the row. Then I used the invoke method to invoke it at row 0.

This works.

2 Likes

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