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

Community site session details

Session Id : 0svt/oi+tqjdpuv69VeFso
Power Automate - Building Flows
Answered

Format currency/date column in html table

Like (0) ShareShare
ReportReport
Posted on 16 Nov 2022 08:21:59 by 74

I am running a database Stored Procedure

from that resulting dataset, I create a html table, with automatic columns selected

that html table then gets some CSS table styling

and the final table then gets sent in an email

 

Everything works fine except for the fact that the 3 currency columns in the table aren't formatted to display that, along with a date column which is an ugly format from the database. 

 

Should I add a Compose step somewhere? How can I use that to access a particular column inside my html table to format numbers/dates?

 

 

drewbty_0-1668586580516.png

drewbty_1-1668586647532.png

 

 

I have the same question (0)
  • Ajinder31 Profile Picture
    530 on 16 Nov 2022 at 09:15:26
    Re: Format currency/date column in html table

    Hi @drewbty , Can you please share the values received and required formats for both date and currecny fields?

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

  • drewbty Profile Picture
    74 on 16 Nov 2022 at 09:38:59
    Re: Format currency/date column in html table

    Example of output from stored procedure.

    Stake and Payout should be to 2 decimal places and include a $ sign. Client DOB should change to dd/mm/yyyy.

    Not that this is just an example of one {} within the array. But there are many. All of them have the same column headers.  

     

    {
    "Table1": [
    {
    "Match": "xxxxx v xxxxx",
    "Market": "xxxxx",
    "Outcome": "xxxx",
    "Stake": 194.7,
    "Price": 1.95,
    "Payout": 254.7,
    "Client First Name": "xxxxx",
    "Client Surname": "xxxx",
    "Client Suburb": "xxxx",
    "Client State": "xxxx",
    "Client Phone": "000000000",
    "Client Mobile": null,
    "Client Email": "xxxxxx@gmail@gmail.com",
    "Client DOB": "1989-03-10T00:00:00"
    },

  • drewbty Profile Picture
    74 on 16 Nov 2022 at 09:41:56
    Re: Format currency/date column in html table

    Edit

  • Verified answer
    Ajinder31 Profile Picture
    530 on 16 Nov 2022 at 09:55:30
    Re: Format currency/date column in html table

    Hi @drewbty , Please try below expressions 

    1. For Currency field. eg. Price 

    formatNumber(item()?['Price'], 'C2')

     
    2. For DOB field

    formatDateTime(item()?['Client DOB'], 'dd/MM/yyyy')

     

    Ajinder31_0-1668592515732.png



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



  • drewbty Profile Picture
    74 on 16 Nov 2022 at 10:14:08
    Re: Format currency/date column in html table

    Excellent solution, thanks!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard
Loading complete