Adding a Script

About this task

Icon for the Script activity

Use the Script activity when you want to run a JavaScript in a workflow.

Procedure

  1. In the Workflow Canvas, open the Project tab.
  2. Select the Workflow dropdown. The Workflow Designer opens.
  3. Open the Activities tab.
  4. Drag the Script workflow activity onto the Workflow Designer.
  5. In the Properties panel, enter a name for the activity in the Display Text field. The name appears on the icon in the workflow.
  6. 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