Creating an action
Actions are what programmers call functions. It is a piece of code that you intend to reuse often in different programs.
There are multiple differences between a workflow and an action. The main difference is that an action can return only one variable, whereas a workflow can return multiple variables. Another difference is that actions are purely JavaScript-based and do not contain any visual programming.
In an action, the in-parameters are defined the same way as in a workflow. However, the return type is a bit different. The return code is always one variable and its value is assigned by using the JavaScript return
command. If you don't want or need any return code, define the return code as void
.
A good naming convention for actions is to start the name of the action with a verb, such as get, set, create, delete, and so forth. Then, describe what the action is doing. A good way to make the name more readable is to capitalize each word (except the first word). Examples...