web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send Email with Excel ...
Power Automate
Unanswered

Send Email with Excel Cell values after formatting numbers

(0) ShareShare
ReportReport
Posted on by

I have created a simple flow which will perform below actions:

 

List Rows Present in a table -> Create HTML Table -> HTML table Styling -> Send Email with HTML table

 

My Excel table consists of some calculations and I have formatted the cell values as needed. (% values as Percentage, decimal places to required decimal values etc).

 

When List Rows Present in a table executed, it returns values without any formatting. For example:

 

cell value: 75% -> Returned as 0.75

cell value: 36.89 -> Returned as 36.8888888888889

cell value: 32.49 -> Returned as 32.4888888888889

cell value: 16.16% -> Retuned as 0.161616161616162

 

I can get all the column values from List rows present in table but not sure how to re-format the values and send email with appropriate figures. Any help or suggestion here?

 

Here is my flow:

 

saiemandi_0-1635354076540.png

 

Appreciated your help.

Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    We can take an Excel file, read and format the content as a HTML table:

    2021-10-27_19-05-48.png

    Each column of the Excel data will be read and returned to us as a string. For example 74.91 will be returned as  "74.91". This means that we will need to convert the text into a number before we can format it as either a percentage or a floating point number. We can use the formatNumber function to format the number into a Percentage or Floating Point number using Standard Format Specifiers (eg. P0 for percentage with no decimal point) tell it how to display the output produced.

     

    Here is an example of a row of data that is actually read from the Excel file:


    "Percentage1": "0.59365695249913",
    "Data 1": "6.03988297605158",
    "Data 2": "18.9339464855052",
    "Percentage2": "0.0827403679605414"

    We can use the Select operation to format each row of data after it has been read from Excel:

    2021-10-27_19-23-54.png

    These are expressions. Note how the item()?[ ] matches the Excel column names:

     

    formatNumber(float(item()?['Percentage1']),'P0','en-us')
    formatNumber(float(item()?['Data 2']),'F2','en-us')
    formatNumber(float(item()?['Percentage2']),'P2','en-us')
    formatNumber(float(item()?['Data 1']),'F2','en-us')

     

    ekarim2020_2-1635360205070.png

    ekarim2020_0-1635359699066.png

    This is the table formatting code which you can copy and paste. I'll add this code below.

    2021-10-27_19-36-03.png

    2021-10-27_19-37-57.png

    This is the Table formatting code:

     

    <style>
    table {
     border: 1px solid #1C6EA4;
     background-color: #EEEEEE;
     width: 100%;
     text-align: left;
     border-collapse: collapse;
     table-layout: auto;
    }
    table td, table th {
     border: 1px solid #AAAAAA;
     padding: 10px;
    }
    table tbody td {
     font-size: 13px;
    }
    table thead {
     background: #1C6EA4;
     border-bottom: 2px solid #444444;
    }
    table thead th {
     font-size: 15px;
     font-weight: bold;
     text-align: left;
     color: #FFFFFF;
     border-left: 2px solid #D0E4F5;
    }
    table thead th:first-child {
     border-left: none;
    }
    </style>

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

     

  • Community Power Platform Member Profile Picture
    on at

    Thank you @ekarim2020 

     

    It helped me to achieve my requirement.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard