You are viewing limited content. For full access, please sign in.

Question

Question

Workflow Script: Iterate through a Multi-value token

asked on March 7, 2014 Show version history

I am writing a Workflow Script and I need to iterate through the values of a Multi-value token but I cannot seem to figure it out. Here are some details about the situation:

 

  1. Token is created in the workflow, before the Script activity is called.
  2. Script activity is called and needs to store information from the token to an outside source.

 

Step 2 requires that I retrieve data from the multi-value token on a index by index basis, where I loop through the values so I only am working with one at a time. The value will also need to be of a data type of 'String'

 

Any help would be greatly appreciated.

1 0

Answer

SELECTED ANSWER
replied on March 17, 2014

Any of these scripts will do the trick.

 

foreach(string value in this.WorkflowApi.GetTokenAsMultiValue("Token 1"))
{
    // Do stuff
}
IEnumerable<object> array = (IEnumerable<object>)this.GetTokenValue("Token 1");
foreach(string value in array)
{
    // Do stuff
}
 
foreach(string value in (System.Collections.IEnumerable)this.GetTokenValue("Token 1"))
{
    // Do stuff
}

 

3 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.