How do I prevent activity 'filter data table' from formatting the first row as a header row?

For this activity,

I get these results:

I need the first line to match the second line (ie. not bold, and not centered). Alternatively, I would rather the first row actually include the names shown above (Employee ID, etc) instead of the first filtered data record. I cannot find the proper combination of settings to make this work.

Thank you,

Bob C

Hi @bob_carl

What is the source of datatable - Prepayspclaimlist?

Also, what filter are you applying?

I assume you are reading datatable from excel before filter activity,if yes, please check property “add headers” that will read first header line as headers and not first line of data as headers.

The source is an Excel Spreadsheet, using the ‘Read Range’ activity. Here is that activity. I have the option ‘Has Headers’, which is checked. I do not see an option anywhere to check ‘add headers’. The ‘Read Range’ activity is inside a ‘For Each Row in Data Table’ activity.

The filter being applied is for column 1, filtered to a specific employee number.

@bob_carl

Yes I meant has headers only :slight_smile:

You said you are using read range activity inside a loop?

Can you show screenshot of your workflow please?

You don’t need to put this activity inside a loop. You simply read range and it’s gonna read the data from excel and save as datatable.

I should add that the resulting table is being displayed in HTML format.. I do not think that is relevant; I should be able to generate the proper format initially.

I am inside a loop because we are executing multiple ‘filter data table’ activities for each of the employees. Here is surrounding workflow:

Hello @bob_carl

The Output of the Filter data table looks like this

First row is the Header

It seems like you are using DT_Filter to build the mail body, is that correct?

Can you share that screenshot of Send Mail’s body editor

Hi @bob_carl

Thanks for sharing! Got it.

When you run your workflow in debug mode and then check the value of filtered datatable from locals panel, what do you see?

Do you see headers correct there?

If yes, then issue may be how are you trying to include the sane in your email

The Filter Data Table activity isn’t doing this. It operates on datatable variables, they have no header row and no formatting.

You’re getting those results when writing to Excel or wherever that data is shown in your screenshot.

The content of DT_Filter is the table, yes.

Here is the editor view

Per the suggestions below from Sonali and P.Ostwick, it sounds like the issue is occuring when adding it to the HTML body. However, I have not found any controls to remove or modify the header line.

On a side note, how do i initiate debug mode?

Yes they are right. It is an issue while mail body is built.

You can debug it using Create HTML Content activity before passing it to Send Mail.

It is actually a known issue, the workaround will be to

Output as CVS
Generate data table again

Use Create HTML Content to build body (HTML Content) - (debugging)

or just use the second data table in Edit HTML Content of the Send Email

It looks like this

Mark it as solution, if it helps, thanks!

@bob_carl

Correct me if I am wrong. Your filtered table already has header, right?

Then in your html output, if you delete those headers and simply add filtered datatable, what happens?

I think it should work if you simply keep the datatable, please try and confirm.

This is a known issue with that activity.

What my team does is places the header into the first row, before creating that html content. That way, the table displays it.

With the argument being your table
:

Inside the invoked code -

DataRow emptyRow = dt.NewRow();
emptyRow.ItemArray = dt.Columns.Cast().Select(c => c.ColumnName).ToArray();
dt.Rows.InsertAt(emptyRow, 0);

2 Likes

It is much better option.

But eventually this bug has to be fixed by UiPath

***** THANK YOU TO ALL WHO RESPONDED *******

Hi @David_Hernandez2

Thank you for sharing!

@loginerror looping you in for review, looks like a bug in Create HTML content activity.

2 Likes

I agree but it’s been like this for years haha.

1 Like

Revisiting this post because of an additional need. I also need to change the column widths. Is the only way to modify this table is to re-create it in CVS format? and then generate the table from there? In other words.. for ANY table modifications is this the only way? Why does the editor not display any ‘tb’ tags? If I can edit the HTML for the email body, why can’t I edit the table itself?

Hi @bob_carl

I also have been struggling alot on this issue, so recently found a solution that worked like a charm.

Refer below post on solution for same.

Its 1 simple expression to have dt converted to html format.