Hi,
I have created RPA challenge workflow using Re Framework. So each row in the excel (Input) I have set a wrong data at least for one field. So i need to capture all the row business rule exception and send it at the completion of the workflow not for every single row. How to send that mail after all the rows completion and in a table format that should be in HTML format.
@Vanitha_VS Yes, you can do this.
Do not send the email inside each transaction.
Instead, whenever a row fails with a Business Rule Exception, save that rowβs details into a DataTable/List.
After all rows are completed:
-
check whether the DataTable has rows
-
convert it to an HTML table
-
send one email using Send SMTP Mail Message
-
set IsBodyHtml = True
Best place in REFramework:
-
collect failures in Process Transaction
-
send the final summary email in End Process
This is the cleanest way to send one consolidated exception report.
how to convert data table to html table
@Vanitha_VS Create a String variable β htmlBody
Then use this in an Assign activity:
htmlBody = ββ + ββ + String.Join(ββ, dt.Columns.Cast(Of DataColumn).Select(Function(c) ββ + c.ColumnName + ββ)) + ββ + String.Join(ββ, dt.AsEnumerable().Select(Function(row) ββ + String.Join(ββ, row.ItemArray.Select(Function(cell) ββ + cell.ToString + ββ)) + ββ)) + ββ
In Send SMTP Mail Message:
-
Body β
htmlBody -
Set IsBodyHtml = True
Hi @Vanitha_VS ,
You may refer this post , it is having the complete code.
Try attached workflow
DatatableToHtml.xaml (10.0 KB)
Cheers
Hi @Vanitha_VS
You could install this package from @lakshman in the Marketplace that has a lot of activities for manipulating datatables - among others DataTable to HTML.
This should make it easy to accomplish what you are trying to do.
Regards
Soren
Check above reference