- Learning ServiceNow
- Tim Woodruff
- 128字
- 2021-07-09 18:48:25
Return value
Workflows, like functions, can call one another. It's possible to create re-usable workflows for commonly used processes, such as change approval, and then call them from the current workflow by simply locating one in the Workflows tab of the workflow editor, and dragging it into the main Workflow window:
In one of these workflows, you can use the Return value workflow activity to return a value back to the parent workflow, just as you might when using the return statement inside of a function in JavaScript. In the Workflow subflow activity on the parent workflow, the Map return value to field allows you to specify the variable name to use to store the returned value. You can access this variable from the scratchpad by using workflow.scratchpad.variableName: