Skip to main content

Notifications

Power Automate - General Discussion
Answered

How to Format Date in the Sent Email?

Like (2) ShareShare
ReportReport
Posted on 3 Sep 2024 22:00:03 by 56
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 56 on 12 Sep 2024 at 23:56:56
    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 56 on 05 Sep 2024 at 01:35:34
    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 56 on 04 Sep 2024 at 23:15:51
    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 56 on 04 Sep 2024 at 23:02:14
    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 04 Sep 2024 at 05:52:34
    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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,367

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,297

Leaderboard
Loading complete