Not applicable

Request Data from collection variable

Jump to solution

I have a SharePoint list that contains three items that define three people with a column of Item Active (type Yes/No) and Employee Name (Person) column.  In my workflow, I have queried this list for items that have the Item Active field marked as Yes, returning two list items.  I store the Employee Name values into a collection variable.  So now I have a collection variable containing two People fields.


Then, I set up a Request Data action, using the collection variable in the "Collect data from *" field.  When I run this workflow, it errors saying that it "Cannot get the full name or e-mail address of user "".".


Is there a way to get this working?  I would like to use a list for managing our employees and not a SharePoint group - if that's possible.  Does a collection variable not work as the source of the field "Collect data from *"?


Thank you in advance.

0 Kudos
2 Replies
Automation Master
Automation Master

Re: Request Data from collection variable

Jump to solution


If I've understood, you're using the collection variable as Assignee of the Request Data action..In that case it doesn't work because the assignee should be a user/group or list of have to process your collection and save each user in a user variable (that will contain all the user in the collection), and then you can assign the Request Data to the user variable


0 Kudos
Nintex Newbie

Re: Request Data from collection variable

Jump to solution

Hi Greg,


Firstly, you cannot insert a collection variable as the source for users.


The workaround depends on what you want to do with the responses, i.e. if there are multiple people in your collection do you a) want to send a task to each person to respond to or b) just wait for the first response (the default behaviour for request data when you assign a SharePoint group for example).


If approach a) then you could iterate through the collection (foreach) and then send a task one at a time.  This is not ideal as you need to wait for each person to complete their task before the next person is notified.  Alternatively if you have a known number of people, you could insert some parallel branches then using the collection operation extract out each person and assign to their own request data action.


If you want an unknown number of people to each contribute (in parallel) or perhaps just the first person to reply, then you need to be a little more creative (sorry if I'm missing a simple solution here).


You could for example collapse your collection into comma delimited list (join option in collection operation action) and then use that resulting list variable to plug in multiple users - however by default if you use the request data action specifically, only the first person would get the task.


So here comes the creative bit...


Create your request data task and publish your workflow.  What is happening behind the scenes is that a custom content type will be published with your requested fields and a custom response form.


Now delete your request data task action and replace it with a "Assign to-do task" action.


That action will allow you to specify multiple people (ref the string you joined above).  Within the action you can select an existing content type (the one you created in the request data action above).  The reason you do this is that Nintex has been very helpful and generated a custom task form off the back of the request data action.


If you specify that same content type in the assign to do task action, the same form will be used as it's essentially bound to the generated content type.


When you generate the task (e.g. use the native all must respond or first response applies options in the action), the fields completed by the users will be stored within your workflow tasks list.


All you need to do is to query the workflow tasks list and extract out the responses and do something with those.  To make this work, make sure you use the "Store task IDs in" variable in your task.  That resulting collection variable is what you iterate through to query the workflow tasks list.


So to summarise, I would suggest:


  • Flatten your collection using split within the collection operation (use ; delimiter)
  • Generate your custom content type using the request data action
  • Delete the request data action
  • Insert a assign to do task action and specify the content type created above
  • Foreach taskID stored in above action, loop through and query the workflow tasks list to extract out the user responses


Hopefully that makes sense!





View solution in original post