dimanche 15 février 2015

Workflow set multiple people values to one Person column

I have a plain text field with Account Id's I'm trying to set a Person column with these values. I have a Visual Studio workflow doing this. I can insert 1 person but I can't seem to figure out the delimiter for multiple. I seen some things saying a comma will work but I'm getting an invalid look-up error with this. And it can't be a semicolon due to the format the Person column expects (see below). Any help would be much appreciated.



String acctId = (String)workflowProperties.Item["Account Id"];
String[] stakeHolders = acctId.Split('\n');
String formattedStakeholders = "";

for (int i = 0; i < stakeHolders.Length; i++)
{
string delimiter = stakeHolders.Length > 1 && i < (stakeHolders.Length - 1) ? ", " : "";

//The Person column expects: -1;#DOMAIN\USERNAME
formattedStakeholders += "-1;#" + stakeHolders[i] + delimiter;
}

Aucun commentaire:

Enregistrer un commentaire