Out site collection template includes numerous SharePoint groups defining project roles, most of which are empty to start, which are tied to Nintex workflows (Nintex Workflow 2013.) We do this for the fairly obvious reason that we do not know who will be in these groups until the project is set up and the site collection is provisioned.
The workflows typically assign tasks to the group, which does not allow our users to filter the task lists for [My] to get a list of what they need to act on. I would like to enumerate the user(s) in the groups and assign the tasks directly to those users. I was hoping to use for-each operator, but it works on a collection, not a "group".
Has anyone accomplished this, or should I classify it under recreational impossibility?
In the case of enumerating a variable set to the group, can that be done with the for-each operator? From what I saw, it needs a collection. Which leads to the second option, how does one assign a group to a collection?
I had been thinking along the lines of your suggestions and did not see obvious ways around these issues. I have not yet RTFM'ed this, so excuse the ignorance.
So, I create a workflow with three variables:
Step 1: Assign a specific group to the variable "theGroup"
Step 2: Collection operation, "Add" Value "theGroup" to target collection "theCollection"
Step 3: For-each "theUser" in collection "theCollection" ...send email notification
Failed to send notification. Cannot get the full name or e-mail address of user "#Project Members".
...#Project Members is the group assigned to the variable "theGroup".
You could use a webservice to call the UserGroup.GetUserCollectionFromGroup which will give you an XML that contains all users in that group. You could then parse the XML into a collection, and use a For Each on that collection to iterate through it and assign tasks to each member.
Hope that helps!
I agree with Mike M. So you need a Web Service and a Query XML action. In the Web Service you call Web URL/_vti_bin/usergroup.asmx and in the Query XML action you use the following XPath:
The steps are described in more detail in this article.
I'm sure it will, but I have not moved on that. I will need to learn a bit more about Nintex, and how best to break out reusable bits like this. I only just started working with both Nintex and SharePoint a few months ago.
The immediate need is to get a very complex and long workflow broken into several more digestible bits, because on occasion, it fails and there is no good solution to start it again.