How to create a List Query with a person/group filter?

  • 13 October 2016
  • 5 replies
  • 18 views

Badge +7

SharePoint; Nintex 2013

Hi!

I have a people collection in my workflow. Then I run a For Each action on the collection, most of the functions seem to work (send each person a mail etc).

But one thing doesn't work:

When I run a Query list action (in the for each person surrounding!) for all IDs with the filter: Created by is equal to person (a people or group variable in the for each action which is going through the collection).

This doesn't work, the collection created with the Query List action is empty.

Thanks for any help!


5 replies

Badge +5

Have you tried to use the "Run now" function in the query action? Does it show results if you fake the query with the "Run now" function?

You can also try to log the values in history to see what he really tries to compare. Jut use the action "log to history" and insert the variable and the created by. Then you can at least see that it really should be equal when running through the for each.

Badge +7

Hi Victor B.‌, thanks for your answer!

The Run now doesn't present any result but maybe that's because its in a for each environment so the variable is not defined yet.

The history shows that the workflow is comparing the same elements (so it SHOULD match!) still it doesn't sad.png

It found a link that looks like its describing my problem perfectly:
https://askmanisha.wordpress.com/2013/11/29/query-list-using-a-person-field/

I tried the last step (deleting the Remove LookupId=”True” ) but it doesn't work.

Do you maybe understand Step 4? Where does he get the display name from?

Thanks in advance!

Badge +7

to Victor B.‌:

http://crenstrom.blogspot.de/2012/12/nintex-query-list-filtered-by-person.html#!/2012/12/nintex-query-list-filtered-by-person.html

This answer is just 3 lines long, but I have the same question. Where did he get the 'perPerson - User ID Number' from?

Badge +5

Hi Nina,

ok I have a few answers for you, the first one is a general tip for you:

1. The "Run Now" function when used always shows this textblock with the query and all ist variables. If you want to get results you can fake it if you delete the variable which would be {variable name} and replace this with something you expect to be there when really running the workflow. This will give you an idea of you result and lets you better understand how to continue with that Information.

2. If you want to get the display name instead of the loginname or account you can always use the action "Set variable" as a little helper action. Just add it right after the for each where you  should already have the value from you collection variable in a people picker format like "domainusername" or with claims tokens and then set a newly created Nintex text variable = For each variable value but before saving, click on the 3 little dots besides of the field and choose the type of information you want to have in your Nintex variable, like in the screenshot of you link at step 4,. There you can choose to get the email adress, the dispaly name or other user information.

Badge +7

Aaah, I've never seen those dots before! Thanks for your answers!! happy.png

Reply