Tuesday, November 22, 2016

SharePoint 2013 Workflow Task Assign Multiple Users to Task Participants / Reviewers / Approvers


To assign multiple users to a task  Assigned / Reviewers / Approves property in an SharePoint 2010 or SharePoint 2013 workflow we need to implement a string value based on the following string format :
{UserID Number(n)};#{Display Name(n)};#{UserID Number(n+1)};#{Display Name(n+1)}
1. First create a string var in Workflow: 
2. Assign Value to this string var: Build String using format above, ensure to 
select Return Field As: 'User ID Number' and 'Display Name'
E.g:  [%Current Item:Modified By%];#[%Current Item:Modified By%]
would appear as :
48;#Dole, Jason R
An example of multiple users:
[%Current Item:Modified By%];#[%Current Item:Modified By%];#[%Current Item:Created By%];#[%Current Item:Created By%]

3. Now assign string variable to Participants user field, be sure to select  Return Field As: String when using the string variable created in Step 1 above.

Be sure to include the ;# delimiter in between users, this is  very important
The key is to use ';#' as both a field and user delimiter, 
If you miss a delimiter and/or try to populate using incorrect data a common error is as follows:
[Coercion Failed: Unable to transform the input lookup data into the requested type.]
exception.
Good Luck!

No comments:

Post a Comment