- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2018 12:08 PM
New at ServiceNow, but not with programming/javascript.
I have a workflow in which I have a Run Script activity that sets a variable value in the ScratchPad (workflow.scratchpad.exec2approve = 'OPS';. In a subsequent Switch Activity, I want to access the value of that variable, but when I type in workflow.scratchpad.exec2approve I get an invalid reference message.
Is there a way to do this? If not, is there a better way to set a value in one activity and access it in a switch activity?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2018 08:29 AM
It's hard to believe, but it really cannot be done (up to Kingston, at least).
In my opionion, Service Now should implemennt the ${} notation to allow to use a workflow variable in Switches (or in any Workflow related context, such as Conditions, where it also does not work).
Hopefully, with the new "Flow Designer" all this is solved...
If this answer was helpful, I would appreciate if you marked it as such - thanks!
Best
Daniel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2018 08:29 AM
It's hard to believe, but it really cannot be done (up to Kingston, at least).
In my opionion, Service Now should implemennt the ${} notation to allow to use a workflow variable in Switches (or in any Workflow related context, such as Conditions, where it also does not work).
Hopefully, with the new "Flow Designer" all this is solved...
If this answer was helpful, I would appreciate if you marked it as such - thanks!
Best
Daniel