web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter Array action in...
Power Automate
Unanswered

Filter Array action in a For each action send an emaill of all items in my sharepoint list instead of items where todays date equals date in SuggestedNextDate column

(0) ShareShare
ReportReport
Posted on by 39

I have a Sharepoint List and Power Automate.  In my 'Filter Array' action that is wrapped in a 'For each' action  it is sending  an email of all items in my sharepoint list instead of just the items where todays date = date value in SuggestedNextDate column.  Why?

 

Here is the Filter Query of the body/value: 

@equals(@{formatDateTime(items('For_each')?['SuggestedNextDate'], 'MM/dd/yyyy')},@{formatDateTime(utcNow(), 'MM/dd/yyyy')})

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @kevindGG Can you please share a screenshot of your flow? You'll need to check the logic of your flow. 

     

    You might find these two tutorials helpful:

     

    Are you using the Microsoft Power Automate Filter Array Action wrong?

     

    In this video tutorial I’ll show you 3 practical ways to use the Filter Array action and how to use it properly.

    1️⃣ Cross-Referencing Data

    2️⃣ Filtering by Key

    3️⃣ Substring Matching

     

    Did you know that the Condition action has a limit of 10 conditions? Although it might look like the Filter Array action can only accept one condition—this is not true. By using the advanced mode you can enter multiple conditions into a Filter Array action with an expression.

     

    IN THIS VIDEO:

     3 Ways to Use the Filter Array Action

    How to use the Scope Action to Group Actions

    How to Check the Number of Items returned from a Filter Array Action

    How to Cross-Reference Data in Excel with a SharePoint List

     How the Filter Array Action Works

     How to Access the Dynamic Content from a Filter Array Action

     How to Filter Items by a Key

    How to Filter Items by Matching a Substring

    How to Use Multiple Conditions in a Filter Array Action

     

    ----

     

    If you are looking for a way to send multiple SharePoint List items that have been assigned to a user in an email—check out this YT Tutorial: How to Send a SINGLE EMAIL ✉️ with multiple SharePoint list items | Build THIS Power Automate Flow

     

    IN THIS VIDEO:

     How to send multiple list items in a single email with a Power Automate Flow

     How to create a dynamic date range

     How to use the Convert Time Zone action

     How to use a Filter Query in the Get Items action

    How to count number of items in an array

     How to use the Select action to extract a users display name and email address

     How to create a unique list of email addresses

     How to use the Create HTML Table action

     How to customize the HTML Table with CSS styles

    How to use the Send an email (V2) action

    How to use the Append to String Variable action

    How to create a custom list of items for an email

    How to use the Send an email (V2) action

    How to display singular or plural text based on the number of items returned

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @kevindGG,

    I think to compare the date in SP list, you should make sure the date format is 'yyyy-MM-dd':

    @equals(@{formatDateTime(items('For_each')?['SuggestedNextDate'], 'yyyy-MM-dd')},@{formatDateTime(utcNow(), 'yyyy-MM-dd')})

     

  • Venkata Golla Profile Picture
    78 on at

    I am guessing you put the send email action in For-each loop.

    Can you please share a screenshot of your flow?

  • kevindGG Profile Picture
    39 on at

    your change in date format does not work.  here is the Flow screenshot

    kevindGG_0-1712958933371.png

     

  • kevindGG Profile Picture
    39 on at

    yup.  see screenshot of Flow same issue exists

    kevindGG_1-1712958980525.png

     

  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @kevindGG I don't think the Filter Array action is necessary in your flow case. You need to use the Filter Query in the Get Items action. 

     

    I'm using the Classic Designer — I find the New Designer a bit buggy.

     

    In my SP list I have 3 items with today's date.

    creativeopinion_0-1712963383974.png

     

    The filter query in my Get Items action would look like this. You will need to use the internal column name of your Date column. Keep in mind that the internal column name may not always match the name displayed in your Sharepoint list. If you aren't sure how to get the Internal Column name, you can refer to this section of one of my YT Tutorials. Ensure that the dynamic content for current date/time is between single quotes.

    creativeopinion_5-1712963504032.png

    Return Count of Items

    Whenever I use a Filter Query in a Get Items action, I always like to return the count of items returned in a Compose action. This is helpful when building a flow and can also be used to troubleshoot your flow.

    Insert a Compose action. Add an Expression. Use the length() function.

    creativeopinion_2-1712963445423.png

    Select the Dynamic content tab and insert the value dynamic content from the Get Items action into the length() function.

    creativeopinion_3-1712963456555.png

    creativeopinion_4-1712963464941.png

    Run a test. Review the outputs. Ensure the number is what you are expecting. If not, there are a couple of things you can do.

    creativeopinion_6-1712963611310.png

    Check the filter query. Toggle open the Get Items action and check the date output. Depending on what time you run this flow and your timezone—the output of the utcNow() function may output the next day.

    creativeopinion_7-1712963655799.png

    If your SP list has a lot of items, you may need to toggle on pagination and set a threshold. Click on the three dots and select settings.

    creativeopinion_8-1712963770394.png

    Toggle on pagination and set a threshold. Don't forget to scroll to the bottom and press Done.

    creativeopinion_9-1712963801431.png

     

    Condition Check

    Add a Condition action to your flow. If items have returned (aka there is number stored in the Compose action—that is not equal to 0), add the rest of your actions to the Yes branch. If not, do nothing.

    creativeopinion_10-1712963846753.png

    Place all other actions into the YES branch. Ensure you are selecting the value dynamic content from the Get Items action to loop through.

    creativeopinion_11-1712963887049.png

     

    If you are looking for a way to send multiple SharePoint List items that have been assigned to a user in an email—check out this YT Tutorial: How to Send a SINGLE EMAIL ✉️ with multiple SharePoint list items | Build THIS Power Automate Flow

     

    IN THIS VIDEO:

     How to send multiple list items in a single email with a Power Automate Flow

     How to create a dynamic date range

     How to use the Convert Time Zone action

     How to use a Filter Query in the Get Items action

    How to count number of items in an array

     How to use the Select action to extract a users display name and email address

     How to create a unique list of email addresses

     How to use the Create HTML Table action

     How to customize the HTML Table with CSS styles

    How to use the Send an email (V2) action

    How to use the Append to String Variable action

    How to create a custom list of items for an email

    How to use the Send an email (V2) action

    How to display singular or plural text based on the number of items returned

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

  • kevindGG Profile Picture
    39 on at

    Thanks.  I take your point that the Filter Array action is necessary in your flow case. You need to use the Filter Query in the Get Items action. But I already have a working example with Filter Query.

    I'll note your above steps if needed but more interested in the possibility of using Filter Array. 

  • Verified answer
    creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @kevindGG You've indicated that your flow isn't working. I'm saying that in your flow the filter array action isn't necessary. You just need to add a Filter Query to your flow so you can filter out the items that match your criteria BEFORE you loop through them.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard