Adding a Script
About this task
Use the Script activity when you want to run a JavaScript in a workflow.
Procedure
- In the Workflow Canvas, open the Project tab.
- Select the Workflow dropdown. The Workflow Designer opens.
- Open the Activities tab.
- Drag the Script workflow activity onto the Workflow Designer.
- In the Properties panel, enter a name for the activity in the Display Text field. The name appears on the icon in the workflow.
-
In the Script menu, select Run
JavaScript. Then, select Script Editor so
you can enter JavaScript code. See Run JavaScript for more details.
Tip: You can get and set the value of workflow variables using the following JavaScript functions:
Snap.wfVariables.getValue
Snap.wfVariables.setValue