Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Incorrect Date Field

(0) ShareShare
ReportReport
Posted on by

Problem: I'm trying to format the date (from "Dynamic Content" )I'm inserting into an email to the US friendly pattern mm-dd-yyyy. I'm using THIS solution posted here earlier. Everything in this solution seems to be working fine except in the email where I place the variable that is set to the date from the column... it shows that date 6 - 7 months in the future. This happens whether I modify the date pattern with the expression or not.  

 

Background: I have a SharePoint list with columns of people and dates. Everyday the Flow pulls the list and compares that date with today's date to see if dates in the columns are 30 day or less from today, which all works fine. It's just when the date get inserted into the email body the variable date is 6 - 7 months ahead. 

 

 

Screen Shot 2019-12-27 at 6.23.42 AM.png

 

 

 

 

  • abm abm Profile Picture
    32,488 Most Valuable Professional on at
    Re: Incorrect Date Field

    Hi @Slloyd 

     

    Try to remove the initialise string variable and use a compose action to format the date.

     

    Thanks

  • Slloyd Profile Picture
    on at
    Re: Incorrect Date Field

    I downloaded the raw JSON (or whatever it is) from the Get Items test run. This what I see for the date column I'm putting into the variable and that I want to show in my email: 

    "Column8":"2020-07-31",
  • Slloyd Profile Picture
    on at
    Re: Incorrect Date Field

    Thanks for the reply. What's the best way to see the output from Get Items and into varDate? 

     

    Thanks,

    Shawn

  • Slloyd Profile Picture
    on at
    Re: Incorrect Date Field
    Thanks for the quick reply! Here's the expression: formatDateTime(variables('varDate'),'MM-dd-yyyy') Can you clarify your #2 answer? Thanks! Shawn
  • manuelstgomes Profile Picture
    6,625 on at
    Re: Incorrect Date Field

    Hi @Slloyd 

     

    This is strange indeed, but clearly an issue in converting the date.. When you run the Power Automate what's the format you see when it's inserted in the varDate? And when it comes from the Get Items?

     

    You may encounter issues if the date is formatted in another format and is returned in a string format and the mapping get's screwed-up.

     

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

  • abm abm Profile Picture
    32,488 Most Valuable Professional on at
    Re: Incorrect Date Field

    Hi @Slloyd 

     

    Couple of things to check.

     

    1. Format of the date expression. Could you post the expression. The screenshot is not very clear.

    2. Run time history values of the date returned from Get Items Step before you format or store in a variable name.

     

    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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492