how can i pass a workflow scratchpad variable to a sub workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2018 11:48 AM
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
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2018 01:07 PM
Okay, your screenshot looks like your workflow is running against the 'sc_req_item' table. Is that correct? If so, you'll need to use Workflow Catalog Variables. You can access these from the hamburger menu. These variables (and their values) are accessed in the same way you would access a regular catalog variable from script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2022 09:21 AM
Marc, your reply to Dave is most helpful. Dave's sentiment is often mine and I really appreciate clear answers from the community.
I have an additional question. I'm trying to rewrite three workflows that run against three separate catalog items to use a subflow for some complicated shared logic.
That logic currently uses scratchpad variables as inputs and internally. I assume the scratchpad is available internally, but what about passing in the values currently held in the scratchpad. Does this instruction explain how to do this, that is, assign the scratchpad to new un-linked catalog values?
If a workflow is associated with Requested Item [sc_request_item], and is not specifically associated with a catalog item, any catalog variable with a blank Cat Item field value is available to all catalog task activities within the workflow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2019 02:37 PM
If you want to pass any values to sub flow by using the Edit Inputs then you need to change the value of glide.workflow.enable_input_variable property to true.
Then using scratch pad you can pass the values to created inputs.