Skip to main content

Notifications

Community site session details

Community site session details

Session Id : nfOD9i7LAPGvd0hBOzY/f9
Power Automate - Building Flows
Suggested answer

Formatting the values in an HTML Table

Like (0) ShareShare
ReportReport
Posted on 17 Oct 2024 18:38:04 by 2
I'm working on a flow that sends an email with an HTML table in the body of the email. The flow works with the exception of the number formatting of the table contents. It's set up by running the "Run a query against a dataset" action, where I pull the contents of a table from a dataset in Power BI. I then create the HTML table using First Table Rows value of that output, and use css formatting to format it into an excel style grid.
 
This is the output
Value1 %   Value2    Value3 Value4    Value5   Value6       Value7 %
0.130416962 1087    1679578214 67805    176.7148114     192089       0.768476209
 
And this is the desired output
Value1 % Value2 Value3 Value4 Value5 Value6 Value7 %
13%  $1,087  $1,679,578,214  $67,805  $177  $192,089 77%
 
 
I've tried using the formatnumber function and other actions to try to format the numbers properly but all fail, usually due to an error that it can't find the field I'm calling.
 
How am I able to format? Here is my flow currently:
  • MM-17101826-0 Profile Picture
    2 on 22 Oct 2024 at 16:40:33
    Formatting the values in an HTML Table
    @SudeepGhatakNZ where in the flow should I be entering this code?
  • Suggested answer
    SudeepGhatakNZ Profile Picture
    14,318 Most Valuable Professional on 17 Oct 2024 at 23:21:32
    Formatting the values in an HTML Table
    For percentage columns
    concat(formatNumber(mul(items('Apply_to_each')?['Value1'], 100), '0'), '%')
     
    For currency columns
    concat('$', formatNumber(items('Apply_to_each')?['Value2'], '###,###'))
     
    For rounding values
    formatNumber(items('Apply_to_each')?['Value5'], '0')
     
     
  • Suggested answer
    PaulSGodden Profile Picture
    47 on 17 Oct 2024 at 20:49:13
    Formatting the values in an HTML Table
    Hi, Might not solve everything but suggest watching Advanced HTML Tables in Power Automate - Formatting cells, rows and vertical tables (youtube.com) which helped me solve a similar problem I was having. There is a section on formatting numbers including decimal places

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started