Excel data in table format in mail body through outlook

we are sending mail through outlook with attachment contains excel …we need to convert that excel data to table format in mail body…

@Gauri_Rawool -

  1. Use Excel application to read excel file.
  2. Store output as Datatable variable
  3. Use For Each Row to iterate throw datatable rows
  4. Create HTML skeleton of table and store that skeleton in side variable.
  5. You can send HTML body using Outlook you just need to make sure isBodyHTML is checked onimage

What is meant by create HTML skeleton of table ?

@mozahra This kind of Format :sweat_smile:

is there any other way we can do without html …

How can we create dynamic table ? If we don’t known size of table.

@Gauri_Rawool If you need the Excel in Mail body then i guess you need to Convert it into A format which is Suitable for Display in a Web page. Hence an HTML is necessary to display an Excel in Email

@sadhanaw As long as the Format of the Excel is Normal , We can make a Dynamic Table as well, But Can you tell me what is meant by Dynamic Table in your case? :sweat_smile:

:sweat_smile: :sweat_smile: :sweat_smile: :sweat_smile: :sweat_smile: :sweat_smile:
Dynamic table means you don’t know how many rows in the excel that will create the HTML table and btw :rofl: :rofl: :rofl: how will you assign the excel data to the html table :joy: :joy: :joy: :joy:

1 Like

Can you try by using loop through the datatable and create the in HTML.

@mozahra Reading the Excel File we’ll get to know the Number of rows, So I Don’t think dynamic part comes in to place :sweat_smile: . Then Accordingly we can create the Html Table

1 Like

@Gauri_Rawool Have you found the Solution yet, Is it possible to send the File or a Screenshot of the File, So we can get to know the Format of Excel

below is my excel file witch is generated from sql…Audit_TRAIL.xlsx (13.3 KB)

@Gauri_Rawool Since it was a Simple Format, It was Pretty easy to Achieve this :
Check the Workflow :
The Output of this Workflow is the Html table that will be present in the htmlTable Variable.
You can use this variable inside the body of Mail Activity with IsBodyHtml Property Set To True
I hope this is What you needed :sweat_smile:
EmailAssignmentWithoutActivity.zip (23.9 KB)

1 Like

one question :rofl: :rofl: :rofl: :rofl: why did you use the DataTable array ? I haven’t seen you use it.

@mozahra If there are multiple Datatables that needs to be converted to Html Table, You can do it using ForEach of those DatatablesArray Count, I had built that Solution for some other person needing that Kind of output :sweat_smile:

1 Like

Thank you for the example!
I used your sequence, but having a couple of errors (‘Columns’ is not a member of ‘System.Data.DataRow’ and ‘Rows’ is not a member of ‘System.Data.DataRow’).
I cannot figure out why your RPA doesn’t throw this error, but mine does.