Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Filter array is not working when Greater than condition is applied

(0) ShareShare
ReportReport
Posted on by 56

Hi There,

 

Fitter Array  not working when applied the below condition.

I need only the array of values where the COUNT(*) > 50 but my flow is returning all the values.

 

It will be a great help to know what is going wrong.

 

 

Krisslee6_0-1631447821026.png

 

 

Below is my flow:

 

Krisslee6_1-1631447917199.png

Filter Array 2 code view.

{
    "inputs": {
        "from""@variables('ArrayOfContent')",
        "where""@equals(items('Apply_to_each')['COUNT(*)'], 1)"
    }
}
 
 

Below is the Array of Content 

______________________________________________________

[
{
"TRUNC(SYS_CREATION_DATE)\t": "11/09/2021 00:00:00",
"LETTER_CODES": "CONS",
"ERROR_CODE": "508",
"ERROR_REASON": "LmsException: Exception caught during SOAP Request Call to DMAAS Web Service.",
"COUNT(*)": "1"
},
{
"TRUNC(SYS_CREATION_DATE)\t": "11/09/2021 00:00:00",
"LETTER_CODES": "CONT",
"ERROR_CODE": "11",
"ERROR_REASON": "ArrayIndexOutOfBoundsException: 1",
"COUNT(*)": "3"
},
{
"TRUNC(SYS_CREATION_DATE)\t": "11/09/2021 00:00:00",
"LETTER_CODES": "CONTRACT",
"ERROR_CODE": "11",
"ERROR_REASON": "ArrayIndexOutOfBoundsException: null",
"COUNT(*)": "82"
},
{
"TRUNC(SYS_CREATION_DATE)\t": "11/09/2021 00:00:00",
"LETTER_CODES": "CONT",
"ERROR_CODE": "11",
"ERROR_REASON": "ArrayIndexOutOfBoundsException: null",
"COUNT(*)": "57"
}

]

*******************************

 

Should return only the below values where COUNT(*) > 50

 

[

{
"TRUNC(SYS_CREATION_DATE)\t": "11/09/2021 00:00:00",
"LETTER_CODES": "CONTRACT",
"ERROR_CODE": "11",
"ERROR_REASON": "ArrayIndexOutOfBoundsException: null",
"COUNT(*)": "82"
},
{
"TRUNC(SYS_CREATION_DATE)\t": "11/09/2021 00:00:00",
"LETTER_CODES": "CONT",
"ERROR_CODE": "11",
"ERROR_REASON": "ArrayIndexOutOfBoundsException: null",
"COUNT(*)": "57"
}

]

*******************************

 

Regards,

RK

  • Verified answer
    Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    Re: Filter array is not working when Greater than condition is applied

    What is happening is that you are applying a greater comparison to a value that is actually a string. Instead of using the dynamic content COUNT(*) on the left side of your comparison. You need to convert it to an integer first, by wrapping that dynamic value within the Int() expression. Then your filter will work.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1