Site workflow to loop into all listItems where column x is empty?


Badge +3

We are using SharePoint 2013 and Nintex forms/workflow 2013. I created a Nintex site workflow and would like to loop into some specific listitems in ListA. The filter is that I only want to loop into the listitems where column x is empty. Which actions do I need to use?


4 replies

Userlevel 2
Badge +11

If the filter  "Column X is null" does not result the expected items, maybe you could try to add a calculated column which sets the value to whatever you like if Column X is empty and to "" if it contains a value; eg. IF(ISBLANK(Column X),"Include",""). Filter the Query List on the calculated column if it equals "Include".

Badge +3

Hi, my question was more about how to loop into all list items by a filter? I dont have a problem with the filter or something.

Userlevel 2
Badge +11

Your Query List for the ID of the found items which are to be stored in a Collection wf variable, eg. colFoundItems. You also need a List Item ID wf variable, eg idCurrentItem. The For-each is then setup using colFoundItems as its source input, and storing the current collection item into idCurrentItem.

 

Within the For-each you can now lookup details of the item with ID=idCurrentItem.

Alternatively you could create collection wf variables for the item details you need inside the foreach, and also have number wf variable numCollectionIndex that you use inside the For-each config to store the Index value. Inside the foreach you can use numCollectionIndex to get an item from the other collections for the current item.

 

Hopefully this is what you're after.

Badge +8

Start by making:

a collection variable named collIDs

A single line variable named targetID

2216i7FDDE5917AFF2638.png

 

You would change the "title" to be whatever your Column X is. Then save the ID field to collIDs. Then you can do operations against the collection using For Each actions.

 

2218i8D8CA030E706BB62.png

 

Then do an Update Item action INSIDE the For Each like so: 

 

2217i8ECD88077AD2184A.png

 

It will now loop through every ID on the targeted list, collect only those with empty Title fields, and update the column Title with the text "THIS IS NOT EMPTY ANYMORE".

 

Reply