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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to filter array...
Power Automate
Answered

Unable to filter array an excel body/value with multiple condition

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
Hi, I'm currently creating a flow where I try to filter Excel using the filter array. I have successfully run the flow by separating the two filters into one filter for 'less than' and another for 'greater than'. After that, I use the intersection compose. However, I wonder if it is possible to create it into one filter array with multiple conditions. I tried using the formulas below but failed. I hope someone can help. Thanks.

@and(
less(@{item()?['_Start_Date']},@{body('Time_tomorrow')}),
greater(@{item()?['_End_Date']},@{formatDateTime(body('Time_today'),'yyyy-MM-ddTHH:mm:ss.0000000')})
)
Screenshot 2024-12-28 071539.png
Categories:
  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at
    Where does "body"  come from?  Is that a separate record holding the comparison dates?

    Here's what works for me:

    {
      "type": "Query",
      "inputs": {
        "from": "@outputs('List_rows_present_in_a_table')?['body/value']",
        "where": "@and(less(item()?['Sent'],'2023-10-31T00:00:00.000'),greater(item()?['Sent'],'2023-09-30T00:00:00.000'))"
      },
      "runAfter": {
        "List_rows_present_in_a_table": [
          "Succeeded"
        ]
      }
    }



    Have you considered including the (OData) filter in the Excel call directly?


     
  • Verified answer
    Pstork1 Profile Picture
    69,665 Most Valuable Professional on at
    Try removing all the extra at signs and curly braces. Those should only be in the outermost comparison.  Use this formula instead.
     
    @and(
    less(item()?['_Start_Date'],body('Time_tomorrow')),
    greater(item()?['_End_Date'],formatDateTime(body('Time_today'),'yyyy-MM-ddTHH:mm:ss.0000000'))
    )

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
     
  • Denisss Profile Picture
    Microsoft Employee on at
    Thankyou Paul. The flow runs as intended.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard