Skip to main content

Notifications

Community site session details

Community site session details

Session Id : Gl3a6zy9vTVHJvawG44b8d
Power Automate - Building Flows
Answered

Setting a date variable

Like (0) ShareShare
ReportReport
Posted on 2 Dec 2021 20:25:25 by

Hi,

I am working on a flow that creates and updates planner task details with a list of information. One piece of information is a date. I initialized the variable as a string and set the variable. See attached. When I update the task details, I use the FormatDateTime expression and use the variable. formatDateTime(variables('xlsxHireDate'),'yyyy-MM-dd') When I test the flow, it fails.

 

Additional details: I use scope control to combine my steps for error handling. It appears I cannot initiate a variable within a scope.  

 

Thanks for the help!
Initialize variableInitialize variableSet variableSet variableExpressionExpressionErrorError

  • Community Power Platform Member Profile Picture
    on 03 Dec 2021 at 01:30:33
    Re: Setting a date variable

    Thank you! That worked!

  • Verified answer
    Ellis Karim Profile Picture
    10,955 Super User 2025 Season 1 on 02 Dec 2021 at 23:34:42
    Re: Setting a date variable

    When reading the Excel file, please set the DateTime Format to ISO 8601

    2021-12-02_23-29-20.png

    Excel stores the date as integers, in a string. Selecting ISO 8601 should convert the data to a date type.

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
David_MA Profile Picture

David_MA 135 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 132 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 125

Overall leaderboard
Loading started