cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lwine
Regular Visitor

Setting a date variable

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

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Super User
Super User

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.

View solution in original post

2 REPLIES 2
ekarim2020
Super User
Super User

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.

Thank you! That worked!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,422)