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 / Count SharePoint list ...
Power Automate
Answered

Count SharePoint list rows with filter array multiple criteria

(0) ShareShare
ReportReport
Posted on by 62

Hello all,

 

I have a SharePoint list which contains three columns (Category, Activity & Tool). I am trying to create a flow to get an output of just the number of rows that matches each column criteria.

 

I tried using a filter array with the expression:

@And(equals(item()?['Title'], 'Communication'), equals(item()?['Activity'], 'With cargo'), equals(item()?['Tool'], 'email'))    

[in the above expression Column and Condition]

And then Compose:

length(body('Filter_array')?['Value'])
 
But I am getting an error at Compose action and I am not even sure this is the right way. Can anyone assist me to fix this so that I only get the number of counts from the SharePoint list with filter criteria for each column?
 
PS: I achieved this in PowerApps using the below expression:
If(
    CountIf(Categories, Category = "Communication" && Activity = "With cargo" && Tool = "email") = 0,
    Blank(),
    CountIf(Categories, Category = "Communication" && Activity = "With cargo" && Tool = "email")
)
 
Categories:
I have the same question (0)
  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @PowerApps999 

     

    Pls try this in compose action:

    length(body('Filter_array'))

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • PowerApps999 Profile Picture
    62 on at

    Thanks @ManishSolanki 

    Your expression works!

    Right now I am trying to bring this count number (integer) to an Update a row action as you can see below:

    PowerApps999_0-1718191688655.png

     

    Since the output of compose is an integer, an error occurs while running the flow (see below). It seems in the 'Update a row- Provide the item properties', it should be an array and not an integer

    PowerApps999_1-1718191847767.png

    I tried the expression : createArray(length(body('Filter_array'))) ; but then the row in excel now is [1].

    How can I 'Update the row' so that the number only is updated without the square bracket?

     

  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @PowerApps999 

     

    There is no need for 'Apply to each' action or loop. The output of compose action is simply an integer but not an array. You can erase or remove the column value 'Provide item properties' from 'Update a row' action & drag out 'Update a row' action out of the loop. Delete "apply to each' action.

     

    Just type the below expression in the textbox for updating the column value:

    {
    "email":@{outputs('Compose')}
    }

    Just copy & paste the above lines in the input column in "Update a row" action. Save & retest the flow.

     

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 581

#3
Haque Profile Picture

Haque 545

Last 30 days Overall leaderboard