How can I retrieve the ListItemCollectionPositionNext variable ?


Badge +1

Hi all,

I would like to based on the ListItemCollectionPositionNext variable (does Nintex  support this ?) to check if the workflow finished retrieving items 

Because I know the SharePoint allows to retrieve max 5000 items per query. I would like to use ListItemCollectionPositionNext variable and check if it is empty. If it not empty the I make another query in the case has more than 5000 items. Otherwise, I will not make a query anymore.

Anyone know this please let me know your solution ?

Thanks a lot

//Tan Nguyen#


3 replies

Userlevel 5
Badge +14

could you describe in details what exactly are you trying to achieve?

what should have it been 'ListItemCollectionPositionNext' variable? some paging info returned by some sharepoint services?

I feel it relates to some of your previous post(s), but from this description actual context is not clear.

Badge +1

Yes Marian, you're right.

Actually, I have a list with more than 5000 items, if I use the Query List action to query all items without filtering, my workflow run and passed through about ~ 4500 items, after that always get failed on start and never completed.

My solution I think is I want to devide the Query Items into small batches based on Loop action, I want to use some variable from SharePoint like ListItemCollectionPositionNext

you can see this article: Nintex Workflow - Querying a List with Paging - Vadim Tabakman 

the purpose is to check this variable to if it not empty (ListItemCollectionPositionNext =="Paged=TRUE&p_ID=5001"). If it is not empty, I will loop more. Otherwise I quit the Loop. Because I know SharePoint allow to do a query max 5000 items.

So how can I can use or find this variable in Nintex ? I coud not see it. Or I have to design a UserDefinedAction and use it ?

Kindly let me know your idea

Thanks alot,

//TanNguyen

Userlevel 5
Badge +14
My solution I think is I want to devide the Query Items into small batches based on Loop action

yes, that's the approach you've to go with.

but there is no such a variable that would control returned batchsize automatically. you have to manage batchsize on your own.

if you use only nintex workflow actions then you either need to exactly specify with a filter conditions what items should be returned, eg: ID>100 && ID<200.

or you could use combination of filter condition and max row limit ('SPecify item limit' option in query list action). 

I want to use some variable from SharePoint like ListItemCollectionPositionNext

there is no such a variable.

the example you linked takes a different approach to the above mentioned. it doesn't use nintex workflow actions but makes direct call to sharepoint webservice.

webservice's specification allows to control batchsize with 'Paging' optional element. the 'ListItemCollectionPositionNext' is just an attribute of the element and it controls where the actual batch should start from. it's value is (typically) taken from previous webservice's call response.

If it is not empty, I will loop more. Otherwise I quit the Loop

with OOTB nintex actions you could manage it so that once you get first empty results from Query list action after several ones that provided some data, you know there is nothing more to return and you are done with processing.

Reply