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 / Change date format rec...
Power Automate
Unanswered

Change date format received from MS Forms in MS Flow for use in email

(1) ShareShare
ReportReport
Posted on by 381

I have an approval 'Leave Request' flow.  It is triggered when a response has been received from an MS Form.  
It runs successfully and produces the desired outcomes, however . . . 
the email sent out via MS Flow upon approval contains the following;
'leave requested for yyyy-mm-dd to yyyy-mm-dd has been approved.'
I would prefer my email to read;
'leave requested for MMM dd yyyy to MMM dd yyyy has been approved.'  i.e., Nov 12 2020 instead of 2020-11-12
I'm guessing I need to initialize variable to accomplish this, however, I'm not sure where in the steps of the flow to add this, nor the syntax for it.

PeggyLang_0-1604677623602.png

Any help GREATLY appreciated.

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    You've sort of answered it yourself really 😄. An expression like this will do what you want:

    formatDateTime(outputs('Date'), 'MMM dd yyyy')

    Just replace outputs('Date') with whatever your date value is.

  • PeggyLang Profile Picture
    381 on at

    @Paulie78 where in my flow do I insert that experssion.  I've 'tinkered' with it, but have not yet been successful.

     

    PeggyLang_0-1604681184561.png

     

     

    PeggyLang_1-1604681333848.png

     

  • Verified answer
    Paulie78 Profile Picture
    8,422 Moderator on at

    Whereever it is you are applying the date field. So in your case, in your "send an email" action. I guess in the body of your email you are inserting dynamic content. You simply delete that dynamic content and put in the expression instead. 

     

    Within the expression delete the bit I put outputs('Date'), leave your cursor placed in the expression and go back to your dynamic content and select the date field you want to reformat and it will go into your expression. 

     

    No need to add another variable etc, because it is only being used once. If it does not make sense, I will try to explain it another way.

  • PeggyLang Profile Picture
    381 on at

    @Paulie78 , so clearly I need my hand to be held . . . 😣
    I didn't remove the field that were working just yet, I just added what I interpretted the replacement to be;

     

    PeggyLang_0-1604684513007.png

     

     

    Here is the error message that was returned;

     

    PeggyLang_1-1604684548261.png

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    It's because you have picked all of the response details from the form (which is an object of values) instead of just the date return from the form response. So you almost have it correct, you just picked the incorrect dynamic data.

  • PeggyLang Profile Picture
    381 on at

    FIGURED IT OUT !!!!

    🎉💃👏


    THANKS SO MUCH !!!!

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Well done, better click that accept solution button then!  😉

     

    If I answered your question Accept it as a solution ✔️ 

    If I helped you out, please give me some Kudos 👍

    Thanks 😙

  • Community Power Platform Member Profile Picture
    on at
    Hi - I think I have got this wrong somehow; the dynamic field I am trying to convert date on is 'Firstdateofleave'??
     
    formatDateTimetrigger((['Firstdateofleave']), 'dd MMM yyyy')
  • Community Power Platform Member Profile Picture
    on at
    Hi - I think I have got this wrong somehow; the dynamic field I am trying to convert date on is 'Firstdateofleave'??
     
    formatDateTimetrigger((['Firstdateofleave']), 'dd MMM yyyy')
  • Community Power Platform Member Profile Picture
    on at

    sorted....

    formatDateTime(triggerBody()?['Firstdateofleave'],'dd MM yyyy')

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