Skip to main content
Nintex Community Menu Bar

Hi,

 

Is it possible to create a site workflow that would send me an email when any list on my site is approaching 5000 items, for e.g. when the number of the lists hits 4500?

 

I have an idea how to create this for an individual list but just wondering if there was any easier way to do it for the whole site in one sweep?

 

For reference I'm using Nintex Workflow 2013 and SharePoint 2013.

Hi @hsidney 



 



SharePoint REST API



You can use the SharePoint REST API to get the ItemCount for a list (per list)



/_api/web/lists/getbytitle('<list title>')/ItemCount



 



You can get the entire lists details using this SharePoint REST API (per site)



/_api/web/lists/



Warning: Result returned is a large amount of text that is not human readable



 



Cheers


If you dont have a lot of lists on the site you could run a workflow like this which query's each list.
Or even run 15 branches in parallel at the same time.
You could do one call web service call to get all the list ID's as above and then put the below workflow in a loop that goes through the lists collection variable.




Hi @hsidney 



 



SharePoint REST API



Here is a better solution using the SharePoint REST API that will return when Items is "gt 4500" 



/_api/web/lists?$select=Id,Title,ItemCount&$filter= ItemCount gt 4500



 



You can use Notepad++ or any online XML Formatter to format the XML results.



How to format or prettify XML in Notepad++ | Code2care



 



 



 



 


Hi Simon, this is similar to the solution I envisaged originally but thanks for mentioning the call web service option, I hadn't thought of that. Unfortunately I am running quite a big site with about 35 lists so I suppose this workflow is going to be quite demanding/slow however it's configured.
Hi Garrett,

Thanks for this – I've never used SharePoint REST API and wouldn't know how to implement this. Do you know of a resource that could help me get started with this?

Google "SharePoint 2013 REST API" for resources.



 



Getting Started



Open your SP site in browser



https://{site_url}/



Just paste this after your Site URL



/_api/web/lists?$select=Id,Title,ItemCount&$filter= ItemCount gt 4500



The Final URL



https://{site_url}/_api/web/lists?$select=Id,Title,ItemCount&$filter= ItemCount gt 4500



 



Cheers


Reply