Select Action

image\Action_Programming_Select.jpg

The Select action is another decision-making feature, which is used with the Case action. The Select action looks at the value contained within a variable (or the value of an expression) and checks it against the list of Case actions you have created, to see if the value in one of the Case actions is the same as the value in the Select action.

Note:
If the Select action finds a match in one of the Case actions, it runs the actions listed underneath that Case action and ignores all the other case actions. If none of the Case action values match the Select action value, a Default set of actions will automatically be run instead. This is a very useful tool when you want a different set of actions to occur depending on the value contained within a variable.

Important Note!

At least one Case action should be included within the Select action – see Case action for more information.

Setting up the Select action:

  1. Add the Select action to your trigger, as described in adding actions. The Select tab will automatically appear when you add the action.

  2. Use the Variable option when you want to compare the value of a variable. Click on the down arrow to the right of the box to open a list of all the variables in your current publication. Alternatively, click on the Create New Variable… button to open the New Variable dialog box where you can create a new variable. By default this option is selected.

  3. Use the Expression option when you want to create an OpusScript statement that will be used as the comparison. When you select this option, the Expression box will be highlighted, click inside the box and type your script.

Note:
Use this option when the value you want to use in the Select action is contained in an OpusScript variable or if you want to combine an OpusScript variable with a page or publication variable – see Expression example.

  1. Click on the Apply button to save your changes.

  2. Add your Case actions to your Select action – see Case action for more information.

Note:
You must have at least one Case action under the Select action, although this action is normally used when you have several cases that you want to match against the Select action.

  1. Now add your actions to the Default action – see Adding a sub-set of Actions for more information.

Note:
Whenever a Select action is used, a Default action will appear underneath the action in the left-hand column of the Actions dialog. The Default action is only activated when none of the values in the list of Case actions match the value in the Select action. A series of actions can be added underneath the Default action by simply clicking and dragging the required action from one of the Action menus in the Actions tab and placing it over the Default action in the Actions Organiser.

Related Topics:

The Case action

Introducing the Programming Actions

Choosing an Action