we are sending mail through outlook with attachment contains excel …we need to convert that excel data to table format in mail body…
- Use Excel application to read excel file.
- Store output as Datatable variable
- Use For Each Row to iterate throw datatable rows
- Create HTML skeleton of table and store that skeleton in side variable.
- You can send HTML body using Outlook you just need to make sure isBodyHTML is checked on
What is meant by create HTML skeleton of table ?
@mozahra This kind of Format
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?
Dynamic table means you don’t know how many rows in the excel that will create the HTML table and btw how will you assign the excel data to the html table
Can you try by using loop through the datatable and create the
@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 . Then Accordingly we can create the Html Table
@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
EmailAssignmentWithoutActivity.zip (23.9 KB)
one question 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
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.