Data Table color coding

Need to highlight in green color if cell values (actual, real) are equal otherwise in red color.

ActualName RealName ActualClass RealClass actualsection realsection

Chotu Chotu 2 2 A B

Assume above one is the sample datatable with multiple rows. So we need to highlight both chotu’s and 2 in green color and A,B in red color. After which we send this html table in email body. So color shouldn’t be distributed


You can use format cell activity to format the cells with the required colour.
and if you need to change to email body with the color, then you will have to make a html tempalte and copy paste the records to it. Then add it to the email by enabling IsHtml IN THE EMAIL ACTIVITY.

Is this data in excel or just as a datatable in UiPath?

If excel use @Rahul_Unnikrishnans method.

If just a datatable and you need to build a HTML Table for email body.

I would loop through each row and then compare the sets of columns, if true build your HTML datatable as a string.

If Match set bgcolor=“green” else bgcolor=“red”


<table border="5" bgcolor="gainsboro">
<tr bgcolor="lightblue">
  <td bgcolor="green">Chotu</td><td bgcolor="green">Chotu</td><td bgcolor="green">2</td><td bgcolor="green">2</td><td bgcolor="red">A</td><td bgcolor="red">B</td>

Thank you the reply!
Yes. But when I use this html bg color the problem is I need to right multiple conditions because I have many columns to compare. Example if column A=ColumnB (bg of that cell green) and Column C=ColumnD and ColumnE=ColumnF. Another condition would be A=B and C!=D and E!=F. A!=B and C!=D and E!=F and so on. Likewise I have 6 column sets to compare. Any better suggestion plz