how can i pass a workflow scratchpad variable to a sub workflow

dave_edgar
Mega Guru

I have defined a scratchpad variable and thought these would carry accross to subworkflows but there are.

Parent workflow > runscript step:

workflow.scratchpad.var1 = 'test';

> subworkflow > runscript step:

gs.log('workflow.scratchpad.var1 ' +  workflow.scratchpad.var1);

 

results in:

workflow.scratchpad.var1undefined

 

what am i doing wrong, currently very tired and confused

7 REPLIES 7

thanks Mark, I've tried it but think i've missed something.

 

It says to added a variable to workflow inputs, but i can't even see where this is.

No problem!  Workflow variables are declared in a form available from the Workflow Editor gear menu.  Check out this link for details.  Feel free to ask again if you get hung up somewhere.

https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/administer/using-workflows/task...

i feel like i'm going insane, I can't see a workflow editor gear icon, this is what i have:

find_real_file.png

This is what i see from the workflow burger icon:
New Workflow
Open Existing
Copy
Publish
Delete
Edit Stages
Edit Catalog Variables
Set Inactive
Expand transitions
Validate Workflow
Show Contexts
Properties
and Workflow Canvas Help