Need help in formatting mail body,Can anyone help me please

OutputExcel2.xlsx (19.4 KB)
Here in above excel I have data. Now for some sheets we don’t have data after 4th row i.e. server name in that case we should case ignore that sheet and we should fetch only excel sheet data which is having data after 4th row. I want to format data into below image and sent it in email body.

Here, cr number, date and server names will vary always. Number excel sheets also will vary like sheets may be less or more.
Can anyone help me please.
image

Hi @Chandini_Roy

You can achieve it by using the read range & some linq

Read the excel sheet by using the use excel file inside that use the for each excel sheet, then use read range to go through rows starting from A4 as our table start from there assuming rows will extend till 100 you can increase it anyway, we will be removing the blanks by using the linq.

if we found out that there is data below the 4 rows we will sending a mail as you need some formatting in the mail i have use Create HTML Content & passed the datatable

& finally pass the HTML content to body of the mail activity.

Your output will look like this

I did not got where you took the start & end time but i guess that is easy part you can figure it out,

Hope this helps :slight_smile:

File for your ref-
Excel_Row_Format_Mail 1.zip (18.7 KB)

Very nice response @AJ_Ask . However, what I would simplify your solution:

1 Like

Hi,
Here if we are having data after 4th row means in email body i want entire sheet data not only the after 4th row data. Can you please help me with this.

image
like shown in this image

Hi @Chandini_Roy

Just add this read range in the if block above the Create HTML Content, This will add the whole sheet data in mail

Here if I am having 3 excel files instead of 1 and same process for all 3 files. finally, should send all 3 excels output in a single mail body. Then how can I do it please help me with this also.

In this case you can use the for each file in a folder activity & inside that you need create a datatable to add values everytime you iterate through Excel files. Then post this loop you can give the datatable with all the data to create HTML content to get combined output in single mail for all excels.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.