What Data Can You See in a Workflow?

  • Local variables declared in a script
  • current object
  • workflow.scratchpad object
  • Variable(s) specific to the activity
  • var ci = new GlideRecord("cmdb_ci_server");
    ci.name = "ThisIsMyServer";
    var id = ci.insert(); // insert record and get sys_id
    workflow.scratchpad.ca_id = id;
    

The workflow.scratchpad object is shared by all activities in a Workflow. It has no properties/values unless populated by a Workflow script.

In the example shown, workflow.scratchpad.ci_id is available for use in all remaining activities in the Workflow.

TIP FROM THE FIELD

Use this code in a script to see all of the variables in the workflow.scratchpad object:

for(x in workflow.scratchpad) {
    gs.log(x);
}

results matching ""

    No results matching ""