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 / Extracting count of va...
Power Automate
Answered

Extracting count of variable from column within Sharepoint table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

 

I am trying to build a flow that extracts the count of various values from a SharePoint table and updates these values into a new row of an excel table.

 

The SharePoint table contains multiple columns. One column contains the status of the entry and has the value either 'Open' or 'Closed'

 

I successfully counted the total number of entries (or rows) in the SharePoint table using 'Get Items' and 'Compose' and deposited this value into my excel table.

 

I need to extract the number of entries in the Status column that have the value 'Open'. From this I can then derive the number of entries that are 'Closed'.

 

update excel flow.PNGfilter array output.PNG

As you can see above my current method takes a long time to run.

Also, the filter array block correctly filters all of the 'Open' entries, but I need the number of these, and I can't figure out how to output this. FYI: After counting the number of entries myself in the output I get the expected number. 

 

Does anybody have a solution?

 

Categories:
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    If you've got your Filter array containing only items where the Status is Open, then you can just use a Compose or Variable with the following expression to count how many items are in your Filter array.

     

    length(body('Filter_array'))

     

    You can then get the number of item's that don't have a Status of Open (Closed) by subtracting the length of that output from the length of Get items.

     

    sub(length(outputs('Get_items')?['body']), outputs('Compose_Open'))

     

    grantjenkins_0-1667220427511.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you, this worked!

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 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard