### For-Each Action Properties

In a message flow, use the for-each action to iterate over a sequence of values and execute a block of actions.

In the Message Flow Editor, click a for-each action to display its properties in the Properties view. Use these properties pages to configure the selected for-each action. The pages are:

- For Each
- Comment
- Namespaces
- Variables

The For Each page has the following options:

Option | Description
--- | ---
For Each Variable | Enter the name of the variable on whose contents the for-each action(s) will be executed.
XPath | An XPath expression that specifies where in the structure of the containing context variable the variable specified in the For Each Variable field is located. To create or edit the XPath expression, click <XPath> (or the XPath_fragment, if one is already defined) to display the XPath Expression Editor.
In Variable | The context variable containing the variable on whose contents the for-each action(s) will be executed.
Index Variable | A variable containing the current number of iterations in the loop.
Count Variable | A variable containing the total number of iterations.

Use the Comment page to add a comment, if desired:

Use the Namespaces page to see a list of defined namespaces or to create a new one.

Use the Variables page to see a list of defined context variables or to create a new one. For more information about context variables, see Message Context in the AquaLogic Service Bus User Guide.