query list not working for the first item in a collection


Badge +4

Hi community,

We use SharePoint Server 2010 and Nintex Workflow 2010 (v2.4.6.0 - International).

I have a strange problem with query list using a collection in a for each loop.

The task sounds fairly easy.

A multi line text field (plain text) in a list contains part numbers each on a separate row.

Now we need to check if one or more of those numbers are also in another list and act on it if this is the case.

The workflow reads the multi line text field into a variable then converts it into a collection variable and then removes the white spaces.

I double checked this because it failed in the beginning when the white spaces were still in place.

The collection now looks like this: "64049500;22006100;64057100;22009100;64007400;71208500;"

Now when I query the other list using the collection in a for each loop the first part number returns always nothing. For testing I use only numbers that are in the lookup list.

It is always the first part number that is failing. I double checked it when changing the order several times.

I cannot see why the query list action fails to return a result for the first item.

Any suggestions? 

Thank you.


4 replies

Userlevel 6
Badge +12

Hello Thomas Olbrich​ -

When using your loop, are you setting the index? Also, are you using a collection operation to "get" the values out of the collection?

Are you able to share a screenshot of your WF, might be easier to troubleshoot happy.png!

Badge +4

Thank you, Jesse.

I also thought about the index. I defined one but don't use it in the loop. When I remove the index the result is the same.

I also do not use collection operations in the loop.

Overnight I got the idea to put a dummy part number in front of the collection. But surprisingly this also does not work.

Even more strange is when I use the first part number twice at the beginning I get a result for the first query but not for the second.

This is all very strange.

I attached some screenshots and also the NWF.

I really hope you or someone else can help me solve the issue.

Thank you.

Badge +4

The problem is solved.

I followed Patrick Hosch's advice I found here: https://community.nintex.com/thread/1304 and wrapped the query list filter with the inline function fn-Trim() which solved the problem.

It is still not clear why there are still leading or trailing white spaces after all the cleaning operations (and just for the first part number). I triple checked this with workflow history and still cannot see any blanks.

The solution is often a surprise and you never stop learning happy.png

I want to thank the Nintex Community which never seems to be short of answers or solutions.

Userlevel 6
Badge +12

Morning -

Glad that you figured it out and was able to get it resolved!

Reply