Back to blog

Solve Common Problems with Dates in Power Automate (Part 1)

byDrew Tattam

Solve Common Problems with Dates in Power Automate (Part 1)
Part 1 of 3

You’ve begun using Power Automate and then you see this “2024-06-20T00:00:00Z”. There’s nothing more frustrating! Dates in Power Automate can be one of the most confusing things to get right, but they shouldn’t be a reason you stop using the app. Throughout this 3-part series, we will solve the most common problems with dates in Power Automate.

The Scenario

Each of my team members add training content that we’re creating to a list in SharePoint. That list looks like this:

There’s a lot of content in this list that can be overwhelming to our team. Every Monday morning Power Automate takes the content that has a due date between the current day and the end of that week and puts it into a table to post to our Teams chat.

The Solution

Without any extra formatting, the automation will send a date in the table with this format: “2024-05-10”. An even worse output happens when times are involved in the due date: “2024-03-20T17:37:17Z”.

To mitigate this, use the formatDateTime function within a Select action.

The function I used here is:

formatDateTime(item()?['DraftDueBy'],'M/dd/yyyy')

The first portion of the function is the name of my date column in SharePoint. You’d want to replace this with the name of your date column.

If you don’t know the name of your column, follow these steps.

1. Go to your SharePoint List

2. Select the gear icon in the top right corner

3. Select List settings

4. Click on the name of the column under the Columns section

5. Locate the name of the column at the end of the URL

The last portion of the function represents the format my team prefers to view dates.

If you’re interested in learning more about the different date formats, check out this information from Microsoft. https://learn.microsoft.com/en-us/system-center/orchestrator/standard-activities/format-date-time?view=sc-orch-2022

I hope you find this tip useful next time you’re building a Flow in Power Automate that uses dates!

If you’re not an existing Knack Training client and want to bring training like this to your company, you may be interested in our Power Automate training track! Download the informational one pager for the course track here and get in touch using the Contact Us form on the website.

Array

View more about this topic

Related everyday office posts

Blog Solving Common Power Automate Problems with HTML Tables (Part 1)

Solving Common Power Automate Problems with HTML Tables (Part 1)

Part 1 of 5 Intro Power Automate allows Microsoft 365 users to automate tasks and streamline workflows across hundreds of...

Blog Solving Common Power Automate Problems with HTML Tables (Part 2)

Solving Common Power Automate Problems with HTML Tables (Part 2)

Part 2 of 5 Intro Power Automate allows Microsoft 365 users to automate tasks and streamline workflows across hundreds of...

Blog Solving Common Power Automate Problems with HTML Tables (Part 3)

Solving Common Power Automate Problems with HTML Tables (Part 3)

Part 3 of 5 Intro Power Automate allows Microsoft 365 users to automate tasks and streamline workflows across hundreds of...