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
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.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (3,182)