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 / Formatting dates and p...
Power Automate
Unanswered

Formatting dates and percentages in email

(0) ShareShare
ReportReport
Posted on by 108

Hello, 

 

I'm building a flow that includes sending emails containing dynamic content pulled from rows in an excel doc. I need to get dates and a percentage number from the excel and include them in the email, but i'm really struggling with how to format these. Image shows how the date and number currently appear in the email. Ideally i need the date to be displayed as DD/MM/YYYY and percentage as 41%.

I understand numbers aren't formatted at all in flows, so I've tried adding an expression and also adding a format number block but i keep hitting the same error (in image). Cam someone point me in the right direction please? and do i need to have this data in a particular format on the excel before it's formatted?

 

Thanks 

Sophie

 

Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    Can you show how the data looks in your Excel file?

  • Verified answer
    v-liwei-msft Profile Picture
    on at

    Hi @sophieclark 

     

    The dates and numbers returned by Excel are all strings.
    For dates:
    You need to use addDays function as well as int function

     

    addDays('1899-12-30',int(DateFiled),'dd-MM-yyyy')

     

    For numbers:
    You need to use float function before using formatNumber

     

    formatNumber(float(NumberFiled),'0.00%')

     

     

    Best Regards,

    Levi

  • sophieclark Profile Picture
    108 on at

    @David_MA attached is how the percentage and dates are formatted in excel, but i can change this if i need to.

  • sophieclark Profile Picture
    108 on at

    Thanks @v-liwei-msft 

     

    Where do i add the functions you've mentioned? I'm not overly familiar with int functions etc so this part is pretty new to me. 

     

    Are you able to show me examples of how these will actually look when added to a flow? 

  • v-liwei-msft Profile Picture
    on at

    Hi @sophieclark 

     

    Can you provide a screenshot of your current flow?

     

    Best Regards,

    Levi

  • sophieclark Profile Picture
    108 on at

    @v-liwei-msft  The flow is pretty extensive so far but this is the section that gets the data from excel and sends the email 

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    You would use the expressions anywhere in your flow where you need the Excel date and percentage to show in the format you desire. Since you don't show your flow, I cannot say exactly where this would be. You said in your initial post that you wanted to e-mail this information, so it may be in the e-mail action depending on what you are doing. For example, you might use it in a compose action or an e-mail action:

     

    exceldateformat.jpg

  • sophieclark Profile Picture
    108 on at

    Thanks @David_MA 

     

    I've tried that and i'm not sure what i'm doing wrong. I have percentage working with an expression now which is great, but still having issues with formatting the dates.  I keep getting the error 'Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'

     

    I've added the compose function and set up the expression correctly (i hope) and then added the expression in to the email too, but still failing. This is the expression i'm using and screenshot of the current set up below: 

     

    addDays('1899-12-30',int(outputs('Get_a_row')?['body/Assigment Start Date']),'dd-MM-yyyy')

     

    sophieclark_0-1678890931868.png

     

    Help!

  • David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at

    To figure out what is wrong, I would change your compose action to return the value from outputs('Get_a_row')?['body/Assigment Start Date'] and remove your expression in the e-mail and run your flow again. Check what is returned from this field in the compose action. It should be returning something like 394488, which would be 1/1/2008. If it is not returning a number, that is the issue.

  • sophieclark Profile Picture
    108 on at

    Thank you @David_MA!

     

    I ran the test and it was blank, which made me realise i was re running a test flow that actually had a blank 'Assignment date' field! Can't believe i didn't notice that was the issue. I now have it working using just the expression and without the compose function. 

     

    Thanks for all of your help!

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard