Reading the column header

I have to do a task where i should find in an excel whether any details are missing if any details are missing i should get the field name where the data is missing and send an acknowledge mail regarding the missed field to reenter and send.

If this is my excel if the employee fails to fill the email i should able to find it and get the field name as email how could i achieve this. i cant give the each row name as i have 17 field to be filled

Hi @soumi_soumiya

Have you given the Datatable.Select(“[Full Name]<>‘’ and [Employee ID]<>‘’”).CopyToDatatable()

print it in output datatable and check the row values

Ashwin S

You can use two for loop here…one for each row and inside that loop for each column loop
And check for that column value if it is blank you can print that header or column name.

1 Like

Thanks for your reply how can we print the header or column name. Can you share me any samples if possible

Let’s say you have read your Excel as datatable dtExcel
Then run a loop
For each ‘row’ in dtExcel
For each item in dtExcel.columns
row(item.tostring)–> will give you value of every column and–> string will give you column name or header name.


Just run this idea once and let me know is it working or not?

Thanks for your reply
Its giving us all the column name but i need only the column name where the row or column filed is empty

Inside second loop
If StringisNullorEmoty(row(item.tosting))
Print item.tostring

1 Like

@soumi_soumiya to whom you are sending an email ? missing details to the respective person ?

it is not working…

What is the output?

its giving as ifstringisnullorempty is not declared

You have to drag if activity from activity pane and inside that condition text area you have to write
Print item.tostring

should we declare the stringisnullorempty its say that u have not declared and it is in protection level


StringIsNullorEmpty is not a variable to be declared…
It is function of string .
In condition box first just type String
Then use Ctrl+Space then you can see IsNullorEmpty option there and select that

Use( row(item.tostring).Tostring)


Write String.IsNullOrEmpty(row(item.tostring))

it give an error that “option strict on disallows implicit conversion from object to string”