cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lwine
Frequent 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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,821)