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 Apps / Count Items in Sharepo...
Power Apps
Unanswered

Count Items in Sharepoint List

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I am trying to figure out if it's possible to count the number of items in 2 sharepoint list.

 

Scenario:

 

I have SPLIst1 and SPLIst2 , both list have status (i.e. submitted, in progress, etc.). Is it possible to count the total number of items with a particular status on both list?

 

Thanks!

Categories:
I have the same question (0)
  • KickingApps Profile Picture
    628 on at

    Short answer, yes.  You might try:  

    CountRows(
    Filter(
    SPListName, 
    Status = "Submitted")

    Do keep in mind, you may run into delegation issues using the above.  If you collect the records and do the same on the collection, you should not have an issues.

     

  • Community Power Platform Member Profile Picture
    on at

    Or use CountIF functions

     

    But first get your DataBase to a collection because this functions used directly on a SP List is going to have Delegation Issues...

  • Community Power Platform Member Profile Picture
    on at

    @KickingApps thank you for that, however I need to count the total number of ticket with submitted status on both list.

  • Community Power Platform Member Profile Picture
    on at

    @Anonymous I have 2 different sharepoint list and I need to count the total number of a particular status on both list.

  • Community Power Platform Member Profile Picture
    on at

    OK, so only sum the CountIF functions

     

    Countif( first_datasource, condition) + Countif( second_datasource, condition)

     

     

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous,

    I agree with @Anonymous's thought almost. Please take a try with the following formula:

    CountRows(Filter(SPList1, Status="submitted")) + CountRows(Filter(SPList2, Status="submitted"))

    Note: Above formula may cause Delegation issue, you could consider take a try to save your SPLIst1 and SPList2 into two separated Collections, and then use the Collection as data source within your formula.

    In order to avoid the Delegation warning issue, please take a try with the following workaround:

    Set the OnVisible property of the first screen of your app to following:

    ClearCollect(SPList1Collection, SPList1);
    ClearCollect(SPList2Collection, SPList2)

    Modify your formula as below:

    CountRows(Filter(SPList1Collection, Status="submitted")) + CountRows(Filter(SPList2Collection, Status="submitted"))

    Best regards,

    Kris

  • andypi Profile Picture
    17 on at

    Trying to do the same thing here. 

    Closest I have got is using 

    https://<tenant>.sharepoint.com/sites/<mysubsite>/_vti_bin/ListData.svc/<ListName>/$count?$filter=<ChoiceField>/Value eq %27Pending%27 and AssignedToId eq <PowerApps.Office365(User()).ID >

    The idea being I can display this value as a Label to the user every time the user changes that field value on the page. 

    Yet when I look to add this as a

    Set(varName, <above response>)

    I am now going to need to use power automate and pass bunch of authentication just to get a simple value. Where <above response would be 

    PowerAutomateCallFromPowerApp(uri).Run

    Seems like a lot of workaround to use PowerApps? but maybe I am close? Would be great if I was just missing a simpler method.

  • andypi Profile Picture
    17 on at
  • Community Power Platform Member Profile Picture
    on at

    So, I am attempting to do this and "CountRows" says that it is not supported by this connector." The connector being used is the "Sharepoint," so not sure how this can be used with a sharepoint list.

     

    Thanks

    tansley

  • dropkic4u Profile Picture
    24 on at

    You're not using the collection like v-xida explained. It worked for me so it should work for you if you create the collection at the screen onVisible property and then use the collection variable instead of your connector name. You need to understand what it means to get a delegate warning.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard