Actions

Most expressions within KnowledgeKube applications are restricted to a particular question group, or to an element such as a button. These expressions tend to fulfil a specific purpose, and are written in such a way that they do not have any use beyond that purpose.

An Action is a general-purpose expression that can be deployed in multiple locations throughout a model using its unique keyword. If you have an expression that you need to use in several places, instead of typing out the full expression in each place you can write it once as an action, then run - or Call - the action wherever it is needed.

Actions can be called in a number of ways. The simplest way is to use the RunAction function, which has the following syntax:

RunAction( "ActionKeyword" );

Replace the word ActionKeyword in the expression above with the keyword of the action you want to run. Triggering this expression will call the specified action, executing the associated expression in its entirety.

The RunAction function's single argument must be a string, so if you write the literal action keyword inside the parentheses, you must remember to put it in double quotes.

A quick way of adding an action's keyword to an expression is to use IntelliSense within the Expression Editor. If you hold down the Alt key and press the right arrow on your keyboard, a list of available actions will pop up. Selecting an item in this list and hovering your mouse cursor over its name will display a tooltip containing the associated expression. Double-clicking any item in the list will place the chosen keyword at your cursor's position.

Using IntelliSense to place an action keyword inside an expression.

To learn how to manage your model's action's, refer to the following topic:

Description Further Reading
Use a special interface to view, add and modify actions in your model. Managing Actions