Access Scratchpad from Switch Core Activity -Kingston

Mike160
Kilo Contributor

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!

1 ACCEPTED SOLUTION

Daniel Oderbolz
Kilo Sage

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

View solution in original post

10 REPLIES 10

Daniel Oderbolz
Kilo Sage

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