For Each Value
This activity runs the activities inside it on token values that have been returned or generated by a previous activity in your workflow definition. See the token this activity produces.
Example: Sally wants to send an e-mail to each e-mail address in a multi-value field. To accomplish this goal, she retrieves all the e-mail addresses in the Email Address field using the Retrieve Field Values activity. She adds the Email Address field value token from the Retrieve Field Values activity to the For Each Value activity, and she places an Email activity inside the For Each Value activity. The Email activity uses the Current Value token as the e-mail address.
How does this activity look in the Designer Pane?
To add this activity to a workflow definition
- Drag it from the Toolbox Pane and drop it in the Designer Pane.
To configure this activity
Drag and drop the activities to perform on each value into this activity.
Select the activity in the Designer Pane to configure the following property boxes in the Properties Pane.
-
Activity Name
Once added to a workflow definition, the default name of an activity can be changed. Providing a custom name for an activity helps you remember the role it plays.
To name an activity
- Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Activity Name in the Properties Pane, replace the default name.
Note: Activity names cannot be the same as any other activity name in the workflow, they cannot be the same as the workflow's name, they must be less than 100 characters, they must contain at least one alphanumeric character, they cannot be "Name," and they cannot be the same as the activity's runtime type (which is usually only an issue with custom activities).
-
Activity Description
Use the Activity Description to provide descriptive text to help you remember the role that the activity plays in the workflow. All activities contain a default description that you can modify while constructing your workflow.
To modify an activity description
- Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Activity Description in the Properties Pane, replace the default description.
-
Selecting Values
The For Each Value activity can dynamically interact with values generated or set in the same workflow definition.
To select which values the activity will be performed on
- Add the For Each Value activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Values in the Properties Pane, type a value in the text box or click the Token button (right arrow) to select a token.
- Optional: To remove an existing token selection, click the red X next to the value
- Optional: To change the order in which the For Each Value activity applies the values, use the green up-and-down arrows .
- In the Designer Pane, drag the activity or activities that should be performed for each token value into the Drop Activities Here section of the For Each Value activity.
- Configure the activities you dragged into the For Each Value activity. If the activity you have selected accepts tokens, you can use the current token value of the For Each Value activity within the selected activity.
Example: Each document routed by your workflow has a list of recipients stored in a multi-value "Recipients" field. You use a Retrieve Field Values activity to retrieve all of the values of the field and store them in a token. You could then use the For Each Value activity to retrieve each individual value of that token and use a Route Entry to User activity to route a shortcut to each person in the "Recipients" field.
Tokens for For Each Value
The For Each Value activity produces the following token, which is available to activities contained within this activity. The For Each Value activity runs one time per value. Each time it runs, the token value reflects the information relevant to the value it is currently processing.
Name | Description | Sample Syntax* |
---|---|---|
Current Value | The current value of the token specified in the For Each Value activity. | %(ForEachValue_Current Value) |
Iteration | The number of times the For Each Value activity has run. | %(ForEachValue_Iteration) |
*The "ForEachValue" portion of the syntax changes to match the activity's name as specified in the Activity Name property box. Note that all non-alphanumeric characters, except underscores, are removed from the name. For example, if you rename the activity Process [for Each], the syntax for the Current Value token will be %(ProcessforEach_Current Value).