Skip to main content

Notifications

Community site session details

Community site session details

Session Id : nZxlTIRUGHIdHbMeoeUsJ3
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,923 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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started
Loading complete