Count Words Action

image\Action_Count_Words.jpg

The Count Words action is used to count the number of words in a Text object or a variable and save the number to a specified variable. The variable containing the stored result could be displayed on the page or used as part of an If action, to check the correct number of words were entered.

Setting up the Count Words action:

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

2. If you want to count the words in a Text object, use the Object option in the Count Words In… panel to select the Text object. Click on the down arrow to the right of the Object option to select the name of the Text object. By default this option is selected.

Note:
Only the names of Text objects on the current page will be listed in the drop down box.

3. If you want to count the words in a variable, use the Variable option in the Count Words In… panel to select the variable. Click on the down arrow to the right of the Variable option to select the name of the variable from the list. Alternatively, click on the New Variable… button to create a new variable – this will open the New Variable dialog box.

Note:
This option is useful if you want to count the number of words entered by a user in an Input Text object because input is normally saved into a variable.

4. Use the Store Result In… panel to select or create the variable in which the number count should be stored. Click on the down arrow to the right of the Variable option to select the name of a variable from the list. Alternatively, click on the New Variable… button to create a new variable – this will open the New Variable dialog box

Note:
The result of this action will always be a number – if there are no words than the result will be 0 (zero).

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

Related Topics:

The Count Lines Action

Choosing an Action