In this Power Automate tutorial, we will discuss the power Automate filter array action with a few examples. And also we will discuss the below points:
- Power automate filter array
- Power automate filter array contains
- Power automate filter array and
- Power automate filter array and or
- Power automate filter array by date
- Power automate filter array remove empty
- Power automate filter array multiple conditions
- Power automate filter array of objects
- Power automate filter array SharePoint list
- Power automate filter array parse Json
- Power automate filter array excel table
- Power automate filter array choice column
- Power automate filter array calculated column
- Power automate filter array @equal
- Power automate filter array not equal
- Power automate filter array less than
- Power automate filter array lookup column
- Power automate get length of filter array
- Power automate filter array starts with
Power Automate filter array
The Power Filter array action, filter or reduce the object from an array if the criteria or condition you provide in the subset match.
Power Automate filter array contains
Here we will see how to use contain in Power Automate Filter action.
Here we will use the below array, from this array we will filter the object whose department contains IT.
[
{
"Name": "Alex",
"Age": 38,
"Department":"Finance"
},
{
"Name": "Michel",
"Age": 38,
"Department":"Finance"
},
{
"Name": "Celia",
"Age": 30,
"Department":"IT"
},
{
"Name": "Ruby",
"Age": 32,
"Department":"Finance"
},
{
"Name": "John",
"Age": 32,
"Department":"HR"
},
{
"Name": "Maven",
"Age": 28,
"Department":"HR"
}
]
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Select Initialize variable action, then provide the variable name, type as an array, and in value add the above array.
Now we will filter the array to get the object whose department is IT, so click on the next step and select Filter array action than in the From provide the above array. Next click on Edit in Advanced Mode, then write the below condition.
@contains(item()?['Department'], 'IT')
Now click on Save and run the flow manually, and you can see the object contains IT.
This is an example of the Power Automate filter array contains.
Read Power Automate update SharePoint list item
Power Automate filter array and
Here we will see how to use and in Power Automate Filter Array action.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Next, we will initialize variable action, then provide the variable name, type as Array, and in value write the below array.
[
{
"Name": "Alex",
"Age": "38",
"Department":"Finance"
},
{
"Name": "Michel",
"Age": "38",
"Department":"Finance"
},
{
"Name": "Celia",
"Age": "30",
"Department":"IT"
},
{
"Name": "Ruby",
"Age": "32",
"Department":"Finance"
},
{
"Name": "John",
"Age": "32",
"Department":"HR"
},
{
"Name": "Maven",
"Age": "28",
"Department":"HR"
}
]
Now we will filter the above array to get the person whose department is Finance and age is 38. So click on the Next step and select Filter array action. Then provide the above array and click on Edit in advanced mode and write the below condition:
@and(equals(item().Department, 'Finance'),equals(item().Age, '38'))
Now click on Save and run the flow manually and you can see the result of the person having finance department and age is 38.
This is an example of the Power Automate filter array and.
Read Power Automate update SharePoint list increment integer field
Power Automate filter array and or
Here we will see And and Or operation in the Power Automate filter array.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Now initialize variable action, then provide the variable name, type as an array, and in value add the below sample array.
[
{
"Name": "Alex",
"Age": "38",
"Department":"Finance"
},
{
"Name": "Michel",
"Age": "38",
"Department":"Finance"
},
{
"Name": "Celia",
"Age": "30",
"Department":"IT"
},
{
"Name": "Ruby",
"Age": "32",
"Department":"Finance"
},
{
"Name": "John",
"Age": "32",
"Department":"HR"
},
{
"Name": "Maven",
"Age": "28",
"Department":"HR"
}
]
Now we will filter the above array to get the person whose department is Finance and age is 38 or person from any department of age 30. So click on the Next step and select Filter array action. Then provide the above array and click on Edit in Advanced mode and write the below condition:
@or(and(equals(item().Department, 'Finance'),equals(item().Age, '38')),equals(item().Age, '30'))
Now click on Save and run the Flow manually, you can see the result in the output of the filter array.
This is an example of a Power Automate filter array and or.
Read Convert SharePoint list item to PDF using Flow or Power Automate
Power Automate filter array by date
Here we will see how to filter array by date using the Power Automate Filter array action.
In this example, we will use the SharePoint list called the Project management list. From this list, we will filter the items whose end date is equal to the current date.
In Power Automate, select the Manually triggered Flow, then click on the next step.
Now we will Get items from the SharePoint list, so click on the Next step and select Get items action. then provide the site address and list name.
Now we will filter the array of items whose end date is greater than or equal to the current date. So click on the Next step and select Filter array action. Then provide the value in the From and provide the
- value: End date from dynamic content
- operator: is greater than or equal to
- value: write the below expression
formatDateTime(utcNow(), 'yyyy-MM-dd')
Now we will create an HTML table by using a filter array. So click on the Next step and select Create Html table action. Then provide the body of the Filter array and click on Shaw advanced options, select the column as custom the map the column with value. To assign a value, you can use this expression format.
item()?['Column Name']
Now click on Save and run the Flow manually and you can see the result create Html table output.
This is an example of a Power Automate filter array by date.
Read Power Automate delete all items in SharePoint list
Power Automate filter array remove empty
Here we will see how to remove empty from an array using the Power Automate Filter Array action.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Select Initialize variable action, then provide the variable name, type as Array, and in value assign the below array.
["1","2","3",""]
Now we will filter the empty from an array, so click on the Next step and select Filter Array action. Then provide the varArray in the From and click on Edit in Advanced Mode, then provide the below condition:
@equals(empty(item()),false)
Now click on Save and run the flow, you can see the empty is removed from the array.
This is an example of a Power Automate filter array removed empty.
Read Power Automate export SharePoint list to excel and send an email
Power Automate filter array multiple conditions
Here we will see how to use Multiple conditions in power Automate Filter array action.
In Power Automate, select the Manually triggered Flow, then click on the next step.
Select initialize variable action, then provide the variable name, type as an array and in value add the below sample array.
[
{
"Name": "Alex",
"Age": "38",
"Department":"Finance"
},
{
"Name": "Michel",
"Age": "38",
"Department":"Finance"
},
{
"Name": "Celia",
"Age": "30",
"Department":"IT"
},
{
"Name": "Ruby",
"Age": "32",
"Department":"Finance"
},
{
"Name": "John",
"Age": "32",
"Department":"HR"
},
{
"Name": "Maven",
"Age": "28",
"Department":"HR"
}
]
Now we will filter to get the name whose department is Finance and age is 38. So click on the Next step and select Filter array action. Then provide the varArray from the dynamic content, and click on Edit in Advanced Mode. Then Provide the below condition:
@and(equals(item()?['Department'],'Finance'),equals(item()?['Age'],'38'))
Now click on Save and run the Flow manually you can see the result in the output of the filter array.
This is an example of a Power Automate filter array with multiple conditions.
Read Power Automate delete file from SharePoint
Power Automate filter array of objects
Here we will see how to filter an array of objects using the Power Automate Filter Array action.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Select initialize variable action then provide the variable name, type as array and in value add the above sample array.
Next, we will filter the above array of people whose age is 38, so click on the next step and select Filter array action. Then provide the above array and click on Edit in advanced mode, provide the below condition:
@equals(item()?['Age'], '38')
Now click on Save and run the flow manually, you can see the result of person whose age is 38.
This is an example of a Power Automate filter array of objects.
Read How do I restore removed files in SharePoint with Power Automate
Power Automate filter array SharePoint list
Here we will see how to filter the array of items in the SharePoint list using Power Automate
We will use the SharePoint list called Project management list, and we will filter the array of items based on Status is completed.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Next, we will get items from the list, so click on the Next step and select Get items action. Then provide the site address and List name.
Next, we will filter the items, status is completed, so click on the Next step and select Filter array action. Then provide the value from get items action, and provide
- value- Status value from dynamic content
- Operator- is equal to
- Value-Completed.
Next, we will create an Html table using Filter items, so click on the Next step and select Create Html table action. Then provide the body of the Filter array, click on Show advanced options, then change the column advanced to custom. Next map the header with values like below:
Header | Value |
---|---|
Name | item()?[‘Title’] |
Start Date | item()?[‘StartDate’] |
End Date | item()?[‘EndDate’] |
Status | item()?[‘Status’]?[‘Value’] |
Assigned to | item()?[‘Assignedto’]?[‘Displayname’] |
Now click on Save and run the Flow manually and you can see the result, the project status is completed.
This is an example of a Power Automate filter array SharePoint list.
Read Power Automate create table with examples
Power Automate filter array parse Json
Here we will see an example of Power Automate filter array parse JSON.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Now we will initialize the array variable and provide the above sample array, so select the initialize variable action and then provide the name, type as an array and in value use the above sample array.
Now click on the Next step and select Parse JSON action, then provide the varArray as content and generate the sample schema by providing the data.
Next, we filter the array to get department is IT, so click on the Next step and select Filter array action. Then From provide the body of parse JSON. Then in value choose Department from dynamic content, the operator is equal to and in value IT.
Now click on Save and run the Flow manually and you can see the result in the Filter array.
This is an example of a Power Automate filter array parse JSON.
Read How to get days of month in Power Automate
Power Automate filter array excel table
Here we will see how to filter excel table data using Power Automate.
So for this example, we will use the below excel table.
In Power Automate, select manually triggered Flow, then click on the Next step.
We will retrieve the rows from the excel table so select List rows present in a table action. Then provide the Location, Excel Demo, File, and Table.
Now filter the array to get the person department is Finance, so click on the next step and select Filter array action, then provide the value from dynamic content, and in value select the department from dynamic content, the operator is equal to, and in value write Finance.
Now click on save and run the Flow manually you can see the result in the body of the Filter array.
This is an example of a Power Automate filter array excel table.
Read How to convert word to pdf using Power Automate
Power Automate filter array choice column
Here we will how to filter the array of SharePoint items based on the choice column using Power Automate.
So for this example, we will use the Sharepoint list called SalesOrder list. In this list status column is a choice column.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Now we will get items from the list, so select Get items action. Then provide the site address and list name.
Now we will filter the array of items, so click on the Next step and select the Filter array action. Then provide the value in the From field from the dynamic content. And in value add the Status value from dynamic content, an operator is equal to, and in value add Delivered.
Now we will create an Html table, so click on the Next step and select Create Html table action. Then provide body in the From field from the dynamic content. Then click on Show advanced options and select custom columns. Then add the below header and value.
Header | Value |
---|---|
Product | item()?[‘Title’] |
Company | item()?[‘Company’] |
Order Date | item()?[‘OrderDate’] |
Status | item()?[‘Status’][‘Value’] |
This is an example of a Power Automate filter array choice column.
Power Automate filter array calculated column
Here we will see how to Filter the array using a Calculated column in Power Automate or Microsoft Flow.
For this example we will use the SharePoint list called Sales order list, in this list the revenue column is calculated column.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Now we will get items from the SharePoint list, so click on the next step and select Get items action. Then provide the site address, and list name in Sharepoint.
Next, we will filter the array of products revenue is less than 500000, so click on the next step and select Filter array action. Then provide the value of the Get item from the dynamic content. Next, click on Edit in Advanced Mode and write the below condition
@less(float(item()?['Revenue']), float('500000'))
Next, we will create an Html table, so click on the Next step and select Create Html table action. Then provide the body of the Filter array from dynamic content. So click on the Show advanced option, choose the custom column, the map the header and value like below.
Header | Value |
---|---|
Product | item()?[‘Title’] |
Unit | item()?[‘Units’] |
AveragePrice | item()?[‘Averageprice’] |
Revenue | item()?[‘Revenue’] |
Now click on Save and run the Flow manually and you can see the output, revenue less than 500000.
This is an example of a Power Automate filter array calculated column.
Read Send an Email when Item added in a SharePoint list using Microsoft Flow
Power Automate filter array @equal
Here we will see how to use an equal operator in the advanced mode of Filter array.
In Power Automate, select the Manually triggered Flow, then click on the next step.
Now we will initialize an array variable and assign the above sample array to it, so select initialize variable action, then provide the variable name, type as an array, and in value provide the sample value.
Next, we will filter the above array to get the details of the person whose name is Alex. So click on the next step and select Filter array action. Then provide the varArray from dynamic content. Then click on Edit in advanced mode, and write the below condition:
@equals(item()?['Name'],'Alex')
Now click on Save and run the Flow manually and you can see the person’s details whose name is Alex.
This is an example of a Power Automate filter array @equal.
Read How to create auto increment column in SharePoint List
Power Automate filter array not equal
Here we will see how to use not equal in filter array using Power Automate.
In Power Automate, select the Manually triggered Flow, click on the Next step.
Now we will initialize the array variable with sample value, so select initialize variable action. Then provide the variable name, type as an array, and in value provide the above sample array.
Next, we will filter the above array based on the condition, Department is not equal to Finance, so click on the Next step and select Filter array action. Then in From field provide varArray from the dynamic content, click on Edit Advance mode and write the below condition.
@not(equals(item()?['Department'], 'Finance'))
Now click on Save and run the Flow manually, and you can see the output in the Filter array action.
This is an example of a Power Automate filter array not equal.
Read Share organization new employee details in Twitter using Microsoft flow
Power Automate filter array less than
Here we will see how to use less than in filter array using Power Automate.
In Power Automate, select the Manually triggered Flow, then click on the next step.
Now initialize array variable with below sample array, so select Initialize variable action, then provide the variable name, type as an array and in value write the below sample array:
[
{
"Name": "Alex",
"Age": 28
},
{
"Name": "Michel",
"Age": 38
},
{
"Name": "Celia",
"Age": 30
},
{
"Name": "Ruby",
"Age": 32
}
]
Now we will filter the above array, persons whose age is less than 32. So click on the Next step and select Filter array action. then provide the varArray from dynamic content. And click on Edit in Advance mode, then write the below condition:
@less(item()?['Age'], 32)
Now click on Save and run the Flow manually and you can see the person’s name whose age is less than 32.
This is an example of a Power Automate filter array less than.
Read Create a Leave request approval workflow using Microsoft Flow in SharePoint Online
Power Automate filter array lookup column
Here we will how to filter an array of items based on the SharePoint Lookup column using Power Automate.
So for this example, we will use the below Sharepoint list i.e. Course list, in this list Technology is the Lookup column.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Now we will get items from the SharePoint list, so click on the Next step and select Get items action. Then provide the site address and List name of the SharePoint list.
Now we will Filter an array of items to get the course which technology is Sharepoint. So click on the next step and select Filter array action, then provide the value of Get items from dynamic content. Then in value select technology value, the operator is equal to, and value in SharePoint.
Now we will create an Html table, so click on the Next step and select Create Html table action. Then provide the body of the Filter array, click on Edit in Advanced mode, and select column to custom. Then map the header with value.
Header | Value |
---|---|
Course | item()?[‘Title’] |
Instructor | item()?[‘Instructor’][‘DisplayName’] |
Technology | item()?[‘Technology’][‘Value’] |
Now click on Save and run the Flow Manually and you can see the result in the output of Create Html table.
This is an example of a Power Automate filter array lookup column.
Read Send text to all emergency contacts from a SharePoint list using Microsoft Flow
Power Automate get length of filter array
Here we will see how to count or get the length of the Filter array using Power Automate.
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Now initialize array variable and assign a sample array, so select initialize variable action, then provide the variable name, type as an array, and in value provide the below sample array.
[
{
"Name": "Alex",
"Age": 28
},
{
"Name": "Michel",
"Age": 38
},
{
"Name": "Celia",
"Age": 30
},
{
"Name": "Ruby",
"Age": 32
}
]
Now we will filter the array to get the person whose age is greater than 30, so click on the Next step and select Filter array action. Then provide the varArray from dynamic content. Next click on Edit in Advanced mode write the below condition:
@greater(item()?['Age'], 30)
Now to calculate the length of the Filter array, click on the Next step and select Compose action. Then in input write the below expression:
length(body('Filter_array'))
Now click on Save and run the flow manually, there are two-person whose age is greater than 30, so the length is 2.
This is an example of a how to get length of filter array in Power Automate.
Read Send a Happy Birthday email to employees using Microsoft Flow in SharePoint Online
Power Automate filter array starts with
Here we will see how to use start with operator in Filter array action using Power Automate
In Power Automate, select the Manually triggered Flow, then click on the Next step.
Now we will Initialize variable action, then provide the variable name, type as an array, and in value provide the above sample array.
Now we will filter the above array whose name starts with C, so click on the Next step and select Filter Array action, then provide the above array from dynamic content. And the provide
- value: item()?[‘Name’]
- operator: Start with
- value: C
Now click on Save and run the flow Manually and you can see the name start with C.
This is an example of a Power Automate filter array starts with.
Related Power Automate tutorials:
- Power Automate Add Days to Date
- Save Twitter Tweets in SharePoint Online list using Microsoft Flow
- Get daily weather reports delivered to your email and phone using Power Automate
- Send myself a reminder in 10 minutes in Power Automate
- Microsoft flow parsing select and expand failed get manager v2
- Log Gmail emails to a Google Sheet using Power Automate
In this Power Automate tutorial, we learned Power Automate filter array action. And also we discuss the below example:
- Power automate filter array
- Power automate filter array contains
- Power automate filter array and
- Power automate filter array and or
- Power automate filter array by date
- Power automate filter array remove empty
- Power automate filter array multiple conditions
- Power automate filter array of objects
- Power automate filter array SharePoint list
- Power automate filter array parse Json
- Power automate filter array excel table
- Power automate filter array choice column
- Power automate filter array calculated column
- Power automate filter array @equal
- Power automate filter array not equal
- Power automate filter array less than
- Power automate filter array lookup column
- Power automate get length of filter array
- Power automate filter array starts with
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.
Hello Bijay,
this
@and(equals(item().Department, ‘Finance’),equals(item().Age, ’38’))
didn’t work for me.
This
@and(equals(item()?[‘Department’], ‘Finance’),equals(item()?[‘Age’], 38))
was much better 🙂