How to add image to datable

i have built a datatable where it has a column as
screenshot with datatype as image. in my process i am taking a screenshot and passing it to add data row and sending it in email as html body format. but i m getting error while adding it to add data row.

kindly help me to resolve the issue


Can you try like this in add data row

New Object() {Value1,Imageval}

If this is not the issue can you please show what you tried and what error you are getting


i have not added new object() before {Value1,Imageval}. i will try with your suggestion

1 Like

Tried with above solution but its not working. it is not even throwing error


Can you please run in debug mode and show what error it is showing please from locals panel you can check the inner exception as well

Are you trying to write data to excel?

if yes then by default datatable will be converted to string it wont use image type


i have debugged it and i am not getting any error for add data row activity
No i am not trying to write it to excel. I am passing this data table to email body


Are you trying to write the data to excel?

if yes then datatable will not write image to excel…it will write a type string …that is the reason you are seeing uiapth.core.image


i am not trying to write it to excel. I am passing this data table to email body


If you need to insert into email then you have to attach the image to email and give the pth of image using img tag and the image would be displayed…

The body is to be in html

Please check this


I dont want it to be added as an attachment. is there a way where i can add it in table only?


It will display that in the cell only…But for it to display you have to attachment and give the path in img tag

Now in your add datarow instead of passing image…you will pass the filename enclosed in image tag and attach the file in attachments