Copying dynamic excel data into email body

I have a report that I want to automate and once downloaded, I need to copy the data from the excel sheet into the email body. However, the data on the spreadsheet is dynamic in that sometimes there may be no data, sometimes 1 row, sometimes 2 rows etc etc.
Also, There are 3 different excel sheets being copied onto the email with text in between.
And to add to the complexity, if there is no data under the headers, I want that section of the email to say “there is no data for this section”
Could anybody advise on how to do this? I will be using Outlook to compile and send the message.
So for example, I want the email to say

"Please see below for todays report details.

Section 1
(This is where excel sheet 1 will be or the no data text)

Section 2
(This is where excel sheet 2 will be or the no data text)

Section 3
(This is where excel sheet 3 will be or the no data text)

Thank you"

Could anyone please advise on this as I am pretty new to UIPath and am struggling to work this one out.
I have attached an example of the excel sheet.

Many thanksexample.xlsx (9.7 KB)

Hello @thetruestorey,

Send outlook Mail Message activity allows to specifies whether the body of the message is written in HTML format throught the option isBodyHtml.

A simple solution could be create a template html of your body text, for example “exampleBody.txt”.

Once you have readen the different datatables from the excel exampleSusana.xlsx (in this example dt1 and dt2) you have to replace each token [DATA_SECTION_X] with the text “There is no data from this section” or with the html code linkedto the dataTable (this task is done in ReplaceToken.xaml using invokeCode activity).

Finally you can send the email with the option IsBodyHtml selected and in the body section the text obtained in the previous steps. (Test_DataTableInBody.xaml) (12.6 KB)

Best Regards,

Hi Susana, I downloaded your example, but I get this error, seuro something is missing, you can help me, thanks

@Tumpiurano, Click manage packages and update your packages.

I already did it, what I imagine is that I need to add something and I don’t know what it is

Hi Tumpiurano,

You need to convert the output of the excel in to html( Datatable to html)and use it in the email.