Introduction

A K2 Data Field can be used as a Destination User in K2. In order for the Data Field to be seen as a Destination User, no spaces should exist in the Value of the Data Field. In this example, Inline Functions are used to remove any spaces in the Data Field Value.

Implementation

The following steps show how to set up the Destination User using a Data Field:

  1. Create a process Data Field. The use of a process Data Field allows the process Data Field to be set dynamically when the process is started per process instance. It is therefore not hardcoded within the process.
  2. Add the destination users in the Value field separated by a delimiter. It is important to note that NO spaces are allowed in the Value field when using it for this purpose.
  3.  

  4. When configuring the destination users, use Inline Functions to split the Data Field Value into the separate destinations.
  5. Drag the Split Function into the Destination Users textbox, which is the final result of what you need returned.
  6. The following screen is displayed.
  7. Drag the Replace Function into the Text value field in order to remove any spaces.
  8. Complete the following:
  9. Text – Drag your process Data Field storing the destination users into this field

    Find – Insert a Space in this field

    Replace – Drag the Empty String Function into this field

    It should look like the image below

  10. Click Finish on this Function.
  11. The Split Function screen will be shown as below.
  12. Insert the Separator to be used. Use the same delimeter that you used in the Data Field to separate the destination users.
  13. Click Finish.
  14. The Destination Users screen is displayed with the Inline Functions.
  15. Continue with the wizard.
  16. When Destination Users are resolved, it will retrieve the Destination Users from the Data Field.

Additional Resources:

The following additional resource can be found on the K2 Underground web site:

How to use a SharePoint List, and by implication a SmartObject to achieve the same result - http://www.k2underground.com/blogs/blackpointtipsandtricks/archive/2010/04/27/routing-tasks-to-multiple-users-from-a-single-sharepoint-list-item.aspx