How to Filter an Array by Date in Power Automate?

During various SharePoint implementations, we often needed to filter array items by date in Power Automate. Recently, while working on a “Project Management System” in SharePoint for one of our clients, I was required to filter SharePoint list items based on Project Start Dates and End Dates.

In this tutorial, I will explain how to filter an array of items based on date in Power Automate using the Filter array action with various examples, such as:

  • Filter an Array of Objects by Today’s Date
  • Filter an Array of Items in SharePoint List with Less Than Today’s Date
  • Filter SharePoint List Items Array Greater than or equal to Today’s Date
  • Filter SharePoint Array Date Less than 7 days or equals Today’s Date

Filter an Array by Today’s Date using Power Automate

Let me show you how to filter an array of objects by Today’s date using Power Automate’s Filter Array action.

I have created an Array of Objects that have date values, shown in the code below.

[
  {
    "ProjectName": "Website Redesign",
    "StartDate": "2025-06-01",
    "EndDate": "2025-07-15"
  },
  {
    "ProjectName": "CRM Integration",
    "StartDate": "2025-06-18",
    "EndDate": "2025-06-30"
  },
  {
    "ProjectName": "Mobile App Launch",
    "StartDate": "2025-07-01",
    "EndDate": "2025-08-20"
  },
  {
    "ProjectName": "Data Migration",
    "StartDate": "2025-06-18",
    "EndDate": "2025-06-10"
  }
]

Now, my requirement is to filter the array objects, where the StartDate value is equal to Today’s Date.

Here are the steps to do this:

  1. To explain this example, I will create a Power Automate Instant cloud flow. If you are new to Power Automate, check out a tutorial on Power Automate instant cloud flow.
  2. Then, add an ‘Initialize variable’ action to assign array values to the variable. Provide a name for a variable, set type as (Array), and a Value parameter with an Array of Objects placed in the code above.
Power Automate Filter array Date
  1. Next, I will take a ‘Filter Array’ action that filters array objects with the Project StartDate as Today’s date. Set the required parameters, as shown below.
    • From: Take the variable value from the dynamic content. In my case, it is VarArrayProjectTracker.
    • Filter Query: Click on Edit in advanced mode -> Add the expression placed in the code.
@equals(@{item()?['StartDate']},@{formatDateTime(utcNow(),'yyyy-MM-dd')})
Filter array Date Power Automate
  1. After that, I will add a ‘Compose’ action to display the filtered items from the previous step. In the Inputs parameter, select Body of filter array action from the dynamic content.
Filter array by Date Power Automate

The flow is completed now. Let’s save and test it. When the flow executes successfully, you can see the result in the compose outputs.

Output:

Filter an Array by Date in Power Automate

This is an example of filtering an array by date using the Power Automate Filter Array action.

Check out How to Filter an Array by Multiple Conditions in Power Automate?

Filter SharePoint List Items Array by Date using Power Automate [Less Than Today]

Let me illustrate this example using the SharePoint list items array as a reference.

Here, I will take a SharePoint list ‘Event Tracker‘ with ‘Event Name’ and ‘Event Start Date’ columns.

Power Automate Filter array Date less than

From the screenshot above, you can see that there are two items with an Event Start Date before Today’s Date.

Now, I want to filter items from the SharePoint list items array that have an Event Start Date less than Today’s date value.

To achieve this, follow the mentioned steps:

  1. Go to the Power Automate Home page, create a Manual trigger flow.
  2. To retrieve items from a SharePoint list, add a “Get items” action. Set the Site Address & List Name.
Filter array Date less than Power Automate
  1. Then, I will take the “Filter Array” action, which will filter the list items by the Event Start Date being less than today’s date. Provide the parameters below.
    • From: Select body/value of the get items action from the dynamic content.
    • Filter Query: Insert the query placed in the table below.
Choose ValueOperatorChoose Value
@{item()?[‘EventStartDate’]}is less thanformatDateTime(utcNow(),’yyyy-MM-dd’)
Power Automate Filter an array less than Date

To display the output from the filter array action, follow these steps.

  1. Following the previous steps, add an “Initialize variable” action to set the empty array. Enter the name of a variable and select the type as an Array.
Filter array Date less than using Power Automate
  1. Then, take the ‘Apply to each’ loop action and select an output from the previous steps to the Body of Filter Array.
Filter Array by date less than Power Automate
  1. Inside the loop, add an ‘Append to array variable’ action to append the values coming from the filter array to an empty array. Set the required parameters.
    • Name: Select an empty array variable from the drop-down.
    • Value: Insert the expression below.
{
  "Event Name": "@{item()?['EventName']}",
  "Event Start Date": "@{item()?['EventStartDate']}"
}
Filter Array date less than Microsoft Power Automate
  1. Now, add a ‘Compose’ action outside of the loop. In the Inputs parameter, take the initialize variable[VarArray – EventDate].
Filter Date Array Power Automate

The flow is completed. Save and run it.

Output:

Power Automate Filter Array by Date

Check out How to Filter an Array by Index in Power Automate?

Filter SharePoint List Items Array Greater Than or Equal Today’s Date

In this example, I took a SharePoint list called ‘Project Tracker’ that has different types of columns, including ‘Project Start Date‘ and ‘Project End Date‘.

Power Automate Filter array Date greater than

Here, I will filter the SharePoint list items array based on the ‘Project Start Date’ values greater than or equal to today’s date.

Begin with the steps mentioned below:

  1. Create an Instant cloud flow in Power Automate that can be triggered with a single click.
  2. First, I will fetch items from the SharePoint list. To do that, add a ‘Get items’ action. Provide Site Address and List Name.
Filter array Date greater than Power Automate
  1. Now, add a “Filter Array” action to filter the SharePoint list items by the Project Start Date, which must be greater than or equal to the current date. Set the From and Filter Query parameters as shown in the image below.
@greaterOrEquals(@{item()?['ProjectStartDate']},@{formatDateTime(utcNow(),'yyyy-MM-dd')})
Filter array Date greater than or equals Power Automate

The filter array will give the output that includes all the default properties of list items. To display only the specific properties coming from the filtered array, I am adding the steps below.

  1. Then, add an ‘Initialize variable’ with the empty array. Provide name and type as an Array.
Power Automate Filter array Date greater than or equals
  1. Next, add an “Apply to each loop” action that will iterate through each item, retrieving from the Body of Filter Array action.
Power Automate Filter array by Date greater than or equals
  1. Then, add an ‘Append to array variable’, which will append the filtered array values to the empty array. Set the Name to [VarArray-ProjectStartDate] and the Value as shown below.
{
  "Project Name": "@{item()?['Title']}",
  "Project Start Date": "@{item()?['ProjectStartDate']}",
  "Project End Date": "@{item()?['ProjectEndDate']}"
}
Filter array by Date greater than or equals using Power Automate
  1. Following the previous step, add a ‘Compose’ action to the appended array values to the empty array.
    • Inputs: I will select the VarArray-ProjectStartDate variable.
Filter array by Date greater than or equals in Power Automate

Now, I will save and manually test the flow.

Output:

Filter array Date greater than or equals in Power Automate

Read How to Filter an Array by String Values in Power Automate?

Filter SharePoint Array Date Less than 7 days or Equals Today’s Date

Here, I will also use the same SharePoint list mentioned in the above example.

Scenario: From the SharePoint list items Array, I want to filter the items where the Project End Date is less than 7 days or equal to Today’s date.

See the steps mentioned below:

  1. Create a Power Automate Instant cloud flow.
  2. Below the trigger, add a ‘Get items’ action to retrieve all the SharePoint list items. Provide Site Address and List Name.
Power Automate Filter array Date less than or equals
  1. To filter the SharePoint list items, add a ‘Filter Array’ action. Provide the required parameters as below.
    • From: Take body/value from the dynamic content of the Get items action.
    • Filter Query: Insert the expression placed below in the advanced mode.
@lessOrEquals(@{item()?['ProjectEndDate']},@{formatDateTime(addDays(utcNow(), 7), 'yyyy-MM-dd')})
Filter array Date less than or equals in Power Automate
  1. Add the ‘Create HTML table‘ action to create a table from the filtered list items. Set the parameters.
    • From: Select Body of Filter Array from dynamic content.
    • Columns: Choose the Custom option.
HeaderValue
Project Title@{item()?[‘Title’]}
Project Start Date@{item()?[‘ProjectStartDate’]}
Project End Date@{item()?[‘ProjectEndDate’]}
Power Automate Filter array today's date
  1. To add styling to the HTML table, I will add a “Compose” action with CSS format.
<style>
table {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
table td, table th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table tbody td {
  font-size: 13px;
}
table thead {
  background: #1C6EA4;
  border-bottom: 2px solid #444444;
}
table thead th {
  font-size: 15px;
  font-weight: bold;
  color: #FFFFFF;
  border-left: 2px solid #f2f2f2;
}
table thead th:first-child {
  border-left: none;
}
Power Automate Filter array less than or equals today&#039;s date
  1. Now, add a ‘Send an email (V2) ‘ action to send a table with filtered SharePoint list items. Configure the parameters, such as ‘To’, ‘Subject’, and ‘Body’.
    • Body: Provide HTML table output and compose outputs here.
Power Automate Filter array by Date less than or equals

Before running the flow, save it by clicking the Save button.

Output:

Filter array by Date less than or equals in Power Automate

This tutorial focuses on filtering an array based on date using Power Automate.

Do let me know if you still have any questions in the comments below.

You may also read:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…