Skip to main content

Notifications

Power Automate - General Discussion
Answered

How to Format Date in the Sent Email?

Posted on by 27
Hello guys,

For more than 2 hours I have been trying to solve a problem with my notification flow when rows are added to the List list.



The goal is to notify all members of that group, the flow works but I have a huge problem with the email formatting resulting with the horrible date.

These are the columns in the list with START (Inizio) and END (Fine) date



I know you can use variables but there is no way I can change the “start date” and “end date” of the event on List so that it is readable.



The email



Can you help me to do this? I would like to see date as dd/MM/yyyy hh:mm
Categories:
  • Verified answer
    BluFin.S Profile Picture
    BluFin.S 27 on at
    How to Format Date in the Sent Email?
    I have found the solution, here you are
     
    formatDateTime(convertTimeZone(triggerOutputs()?['body/DataeOraFine'], 'UTC', 'Central European Standard Time'), 'dd-MM-yyyy HH:mm')
     
  • BluFin.S Profile Picture
    BluFin.S 27 on at
    How to Format Date in the Sent Email?
    One last issue..ho do i add the time zone coversion from UTC to CET (UTC +1) in this string? @Reassuring
     
    formatdatetime(triggerOutputs()?['body/DataeOraFine'],'dd-MMM-yyyy hh:mm')


  • BluFin.S Profile Picture
    BluFin.S 27 on at
    How to Format Date in the Sent Email?
    Update

    I have tweaked a but the code and now IT WORKS! Awesome





    Just one last detail.
    How can I format the date as 07/09/2024 instead of using the name of the month in English i.e. SEPTEMBER?
    To add the same formatting to the second date, do I add another variable?

    Thank you very much
  • BluFin.S Profile Picture
    BluFin.S 27 on at
    How to Format Date in the Sent Email?
    Thank you for your time @Rhiassuring but i got this error:



  • Rhiassuring Profile Picture
    Rhiassuring 8,690 on at
    How to Format Date in the Sent Email?
    Hi there, 
     
    I see you're initializing your variable however you haven't pointed it at the Start Date which is shown in the Dynamic Content from your trigger action.
     
    You need to apply your formatting to that.
     
    Here's an example:
     
    formatdatetime(triggerOutputs()?['body/DataeOraInizio'],'dd-MMM-yyyy')
     
    Then, you'd use that variable in your email body.

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,191

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,419

Leaderboard

Featured topics