🎉 Our Office 365 Reporting Tool is now available in Azure Marketplace 🚀
This website uses cookies to improve your experience. We'll assume you're ok with this. Know more.
SharePoint Online

How to Get List Item Count in SharePoint Online

Are slow load times and unresponsive performance holding you back from getting the most out of your SPO sites? One common factor behind these issues is an excessive number of items in SharePoint lists. By optimizing these overloaded lists, you can improve site responsiveness and avoid threshold errors. Therefore, this guide will show you how to get the total item count in SharePoint lists within your Microsoft 365 environment.

Using SharePoint Online Site

Microsoft 365 Permission Required
Site Owner Least Privilege
Global Admin Most Privilege
  • Go to the respective SharePoint Online site using a web browser.
  • Navigate to the Settings (⚙️)»Site contents.
  • Here you will see all the unhidden lists available on the SharePoint site along with their item counts displayed in the Items column.
Using SharePoint Online Site

Using Windows PowerShell

Microsoft 365 Permission Required
Site Owner Least Privilege
Global Admin Most Privilege
  • Connect to the SharePoint Online site using PnP PowerShell (requires PowerShell 7 or above) with the below cmdlet.
  • Windows PowerShell Windows PowerShell
     Connect-PnPOnline –Url <SiteURL> -TenantName <TenantName> -ClientId <ClientId> -CertificateThumbprint <CertThumbprint>
  • Then, run the following cmdlet to get the item count from both hidden and unhidden lists for the respective SharePoint site.
  • Windows PowerShell Windows PowerShell
     Get-PnPList | Where-Object {$_.BaseType -ne "DocumentLibrary"} | Select Title, ItemCount 
Using Windows PowerShell

Using Windows PowerShell Script

Microsoft 365 Permission Required
Site Owner Least Privilege
Global Admin Most Privilege
  • While the above cmdlet displays the item count in a SharePoint list from the specified site, retrieving the lists and their item counts from all sites requires multiple loops and operations.
  • Therefore, we've prepared a PowerShell script that helps you identify lists, retrieve their item counts, and filter out inactive lists on each SharePoint site.
  • Download and run the following script in Administrator PowerShell (version 7 or higher required) as outlined below.
  • Windows PowerShell Windows PowerShell
     ./GetSPOListItemsCount.ps1 -TenantName <TenantName> -ClientId <ClientId> -CertificateThumbprint <CertThumbprint>
Using Windows PowerShell Script
GetSPOListItemsCount.ps1

Effortlessly manage lists in SharePoint Online for enhanced efficiency with just a few clicks!

The AdminDroid SharePoint Online reporting tool provides you detailed report on all lists in your SharePoint Online environment. The following capabilities give you full control over your SharePoint Online lists and reduce the time spent managing them.

Protect Important Data with List Versioning

Review the lists with no versioning report and enable versioning for critical lists to prevent the risk of permanent data loss or to retain existing content after modifications in SharePoint Online.

Get a Quick Glimpse of SPO Lists

Explore the SharePoint Online lists dashboard to instantly gain valuable insights into all lists across the organization, based on their configurations and activities.

Easily Delete Inactive Hidden SharePoint Lists

Utilize the SharePoint Online hidden lists report to identify hidden lists that are no longer active and remove the unwanted ones to optimize storage in your SPO environment.

Ensure Data Security with IRM-Enabled Lists Tracking

Monitor IRM enabled lists report to identify any critical lists that lack protection and take corrective action to prevent unauthorized access or data leaks.

Export SPO Lists Details in Various File Formats

Get instant access to your list item count details by exporting report in various formats, such as CSV, XLSX or RAW, with direct values for easy processing in other apps.

Secure Sensitive Lists with Unique Permission Tracking

Rectify permission inconsistencies with the help of the custom permission lists report, ensuring that sensitive lists are secured with granular access control.

In addition to getting the list item count in SharePoint Online, AdminDroid’s SPO management tool provides robust features that allow you to effectively track every aspect of SharePoint Online. This includes tracking document libraries, site collections, inactive sites, site groups, and a summary of daily activity and site usage. This enables you to streamline SPO environment management.

Explore a full range of reporting options

Important Tips

Turn on versioning in SharePoint lists to prevent data loss and ensure data preservation, allowing users to restore previous versions when needed.

Apply Information Rights Management (IRM) to a SPO list to secure sensitive files attached to it by restricting actions such as downloading, printing, and copying.

Use item level permissions in SharePoint lists to ensure users can access or edit only their data, while restricting them from modifying other users' items.

Common Errors and Resolution Steps

The following are the possible errors and troubleshooting hints while dealing with SharePoint Online list item count.

Error WARNING: Setting property 'RowLimit' to '50' failed with exception 'Object of type 'System.String' cannot be converted to type 'System.UInt32' Value will be ignored.

This error occurs because the RowLimit property expects a value of type UInt32 (an unsigned 32-bit integer), but a string is passed instead.

Fix To resolve this error, ensure that the 'RowLimit' value is properly cast to ‘UInt32’. Here's how you can modify the cmdlet to correctly cast the value:
Set-PnPView –List <ListTitle> -Identity <ViewName> -Values @{Paged=$true;RowLimit=[UInt32]"35"}

Error Connect-PnPOnline: A parameter cannot be found that matches parameter name 'Interactive'.

This error occurs when you try to execute the script or ‘Connect-PnPOnline’ cmdlet in a version of PowerShell earlier than 7.

Fix Install PowerShell 7 or a later version, and then execute the script or cmdlet.

Error Try refreshing the page. Something went wrong and we couldn’t get the page to display. The number of items in the list exceeds the list view threshold, which is 5000 items. You can return to the list to select a different view or visit the following article for guidance on how to work around the issue: manage list and libraries with many items.

This error occurs when the number of items in the list exceeds SharePoint's limit of 5,000 items, making it too large to display all at once.

Fix To resolve these types of list view threshold errors, follow effective strategies to manage large lists and libraries in SharePoint Online.

Error Get-PnPList: Attempted to perform an unauthorized operation.

This error occurs when you try to get lists from a site that you don’t have access to. Even if you’re a global admin or SPO admin, accessing specific sites requires site level permissions.

Fix Assign yourself as the site owner or admin of the respective site to retrieve the lists from it.

Frequently Asked Questions

Track SharePoint Online List Items to Prevent Storage Issues and Optimize Management!

How to find unused SharePoint list based on last modified time?

How to find unused SharePoint list based on last modified time? +

SharePoint Online lists are essential for asset management and collaboration in an organization. However, as usage grows, it's common for some lists to become inactive. These SharePoint Online inactive lists can impact performance and occupy valuable storage space, making it crucial to address them for a more efficient collaborative environment.

Identify inactive/unused lists in SharePoint Online

  • Although the UI offers the ability to get all lists in a SharePoint site, it does not allow filtering to see only inactive lists based on the last activity time. However, you can achieve this by executing our PowerShell script, 'GetSPOListItemsCount.ps1', with the ‘InactiveDays’ parameter.
  • ./GetSPOListItemsCount.ps1 -TenantName <TenantName> -ClientId <ClientId> -CertificateThumbprint <CertThumbprint> -InactiveDays <Days>
  • For example, by executing the above cmdlet with the 'Inactive days' parameter set to 100, you can retrieve all SharePoint lists that have been inactive for over 100 days, along with their item counts.
  • Similarly, you can include the 'SiteUrl' parameter along with the respective site URL in the cmdlet to list only the unused lists within a specific site.
  • ./GetSPOListItemsCount.ps1 -SiteUrl <URL> -TenantName <TenantName> -ClientId <ClientId> -CertificateThumbprint <CertThumbprint> -InactiveDays <Days>

Tired of endless scrolling through site after site to find unused SharePoint Online lists?

  • With the SharePoint Online inactive lists report in AdminDroid, you can view all inactive lists across your sites in one dedicated place.
  • This report provides detailed information on each list's last activity date and the number of inactive days, and more.
inactive-list-in-spo-with-scheduling-admindroid

Handy tip: Use the Schedule (⏰) option to receive automated insights on inactive SharePoint lists, allowing you to take appropriate actions.

How to change the number of items displayed in a SharePoint Online list view?

How to change the number of items displayed in a SharePoint Online list view? +

Managing large lists in SharePoint Online can impact performance, especially when viewing thousands of items at once. To maintain site’s efficiency, it's important to limit the number of items displayed in a view for SharePoint lists. This helps ensure faster load times and more consistent performance across the lists.

Follow these steps to modify the number of items displayed in a view in SharePoint Online:

Change the number of items displayed in a list via the SPO site

  • Open the desired SharePoint list and select Edit current view from the 'view' drop-down.
  • Expand the Limit Item section on the 'Edit View' page to view the number of items displayed in that specific view, which defaults to 30.
  • Change the value to display the desired number of items in that view and click OK.
number-of-items-displayed-in-list-view

Limit results per page in SharePoint Online using PowerShell

  • Connect to the desired SharePoint Online site using the 'Connect-PnPOnline' cmdlet. Then, run the following cmdlet, replacing <ListTitle> with the list's name, to check the item count in the views.
    Get-PnPView -List <ListTitle> | Select Title, RowLimit, DefaultView | Format-Table –Autosize
  • To change the number of items displayed in the specified view, run the cmdlet below, replacing <ViewName> with the name of your view and <ItemCount> with the number of items to display.
    Set-PnPView –List <ListTitle> -Identity <ViewName> -Values @{Paged=$true;RowLimit=[UInt32]"<ItemCount>"}
set-items-displayed-in-list-view-with-cmdlet

How to get number of items in a SharePoint list using Power Automate?

How to get number of items in a SharePoint list using Power Automate? +

SharePoint Online lists often manage key data like project tasks or support tickets. For example, a project management team needs to quickly assess the number of open tasks to prioritize workloads and meet deadlines. Automating the tracking of list items with Power Automate helps ensure timely and accurate updates, eliminating the need for manual monitoring.

Power Automate flow to count items in a SharePoint Online list

To automate the process of counting the number of rows in a SharePoint list using Power Automate, follow these steps:

  • Sign in to the Power Automate and create a new Scheduled cloud flow. Set a name for the flow and specify the desired frequency for how often you want it to run.
  • Add the Send an HTTP request to SharePoint action. Configure it with your SharePoint site URL and use the following Uri endpoint to get the item count from your list:
    /_api/web/lists/getbytitle('<ListTitle>')/ItemCount
  • Add a Compose action to extract the item count from the HTTP request response using the provided expression.
    body('Send_an_HTTP_request_to_SharePoint')?['d/ItemCount']
  • Add the Initialize variable action to create a variable. Set its type to Integer and give it an appropriate name.
  • Add the Set variable action to assign the item count obtained from the "Compose" action to your initialized variable.
  • Add the Send an email (V2) action to notify yourself or others. Include the variable output in the email body or subject. Finally, save and test the flow to ensure it operates correctly.

For a clear visual representation of the flow, please refer to the GIF provided below.

list-count-power-automate-flow

What are the limitations of SharePoint Online list?

What are the limitations of SharePoint Online list? +

Understanding the limitations of SharePoint Online lists is essential for designing lists that maintain good performance and usability on your site.

Here are some key limitations of SPO lists that you should be aware of:

  • List view threshold The list view threshold limit is 5000 items. This means that when a list exceeds this number, you can’t perform certain operations like filtering and sorting.
  • Item limit A single list can store up to 30 million items. However, you can only view up to 5000 items at a time. Viewing more than this can cause a list view threshold error.
  • File size limit The maximum size for the file attached to the list item is 250 MB. There is no restriction on the number of attachments per list item, but having many attachments can impact performance.
  • Custom permission limit When a SharePoint Online list exceeds 100,000 items, you cannot modify permissions at the list level. However, you can still set unique permissions for individual list items. For better performance, it's recommended to manage unique permissions for up to 5,000 items, even though the maximum limit is 50,000.

What is the purpose of getting items count in SharePoint Online lists?

What is the purpose of getting items count in SharePoint Online lists? +

In certain situations, finding the count of items in SharePoint Online lists is crucial for M365 admins! Here are some of the most common purposes:

  • Content organization and management Tracking the SPO lists item count helps manage data growth, allowing you to organize and maintain your content more efficiently.
  • Workflow management Many SharePoint lists are used in workflows. Knowing the number of list items allows admins to track the number of pending tasks, approvals, or workflow stages, aiding in workload management.
  • Data validation and integrity During data imports, item count can help identify and cross-check any additional data manipulations.
  • Storage optimization Archiving old or unused important lists with a large number of items helps free up space for active lists, minimize clutter, and ensure quicker access to frequently used data.
+

Kickstart Your Journey With
AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities

Download Now
User Help Manuals Compliance Docs
x
Delivering Reports on Time
Want a desired Microsoft 365 reports every Monday morning? Ensure automated report distribution and timely delivery with AdminDroid's Scheduling to your email anytime you need.
Delivering Reports on Time
Schedule tailored reports to execute automatically at the time you set and deliver straight to the emails you choose. In addition, you can customize report columns and add inteligent filtering to the activities just from the previous day to suit your Microsoft 365 report requirements.
Set It, Schedule It, See Results- Your Reports, Your Way, On Your Time!
Time Saving
Automation
Customization
Intelligent Filtering
Give Just the Right Access to the Right People
Grant fine-tuned access to any Microsoft 365 user with AdminDroid’s Granular Delegation and meet your organization’s security and compliance requirements.
Give Just the Right Access to the Right People
Create custom roles loaded with just the right permissions and give access to admins or normal users within AdminDroid. The result? A streamlined Microsoft 365 management experience that aligns your organization's security protocols and saves your invaluable time and effort.
Align, Define, Simplify: AdminDroid's Granular Delegation
Smart Organizational Control
Effortless M365 Management
Simplified Access
Advanced Alerts at a Glance
Receive quick notifications for malicious Microsoft 365 activities. Engage with the AdminDroid’s real-time alert policies crafted to streamline your security investigations.
Advanced Alerts at a Glance
Stay informed of critical activities like suspicious emails and high-risk logins, bulk file sharing, etc. Through creating and validating ideal alert policies, AdminDroid provides a comprehensive approach to real-time monitoring and management of potential threats within your organization.
AdminDroid Keeps You Always Vigilant, Never Vulnerable!
Proactive Protection
Real-time Monitoring
Security Intelligence
Threat Detection
Merge the Required Data to One Place
Combine multiple required columns into one comprehensive report and prioritize the information that matters most to you with AdminDroid’s Advanced Column Customization.
Merge the Required Data to One Place
This column merging capability offers a flexible way to add different columns from various reports and collate all the essential data in one place. Want to revisit the customized report? Save it as a 'View’, and your unique report is ready whenever you need it.
Merge with Ease and Save as Views!
Custom Reporting
Unique View
Desired Columns
Easy Data Interpretation
Insightful Charts and Exclusive Dashboards
Get a quick and easy overview of your tenant's activity, identify potential problems, and take action to protect your data with AdminDroid’s Charts and Dashboards.
Insightful Charts and Exclusive Dashboards
With AdminDroid charts and dashboards, visualize your Microsoft 365 tenant in ways you've never thought possible. It's not just about viewing; it's about understanding, controlling, and transforming your Microsoft 365 environment.
Explore Your Microsoft 365 Tenant in a Whole New Way!
Executive overviews
Interactive insights
Decision-making
Data Visualization
Efficient Report Exporting for Microsoft 365
Downloading your reports in the right file format shouldn’t be a hassle with AdminDroid’s Report Export. Experience seamless report exporting in various formats that cater to your needs.
Efficient Report Exporting for Microsoft 365
Navigate through diverse options and export Microsoft 365 reports flawlessly in your desired file format. Tailor your reports precisely as you need them and save them directly to your computer.
Take Control, Customize and Deliver- Your Office 365 Data, Exported in Your Way!
Easy Export
Seamless Downloading
Data Control
Manage Microsoft 365

Get AdminDroid Office 365 Reporter Now!