- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 12:14 AM
i want to pass the scratchpad values from parent to child workflow using parallel flow launcher.
am setting some scratchpad values in parent workflow if i try to access that values in child workflow means am getting an error as "Undefined".
Thank you for any help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 08:34 AM
Not sure if you've read this, but you need to define your inputs from your parent, to your child, and make sure to do a return value from the child to the parent:
https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/workflow-activities/task/t_VariableWorkflowSubflow.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 12:26 AM
Hi
Please send a code snippet of how you're setting and retrieving the values from scratchpad.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 12:57 AM
Parent Workflow:
in parent Workflow Am calling my sub workflow like this
workflow.scratchpad.identifier = current.identifier;
var desc = '38954899#38954870#38954909#38954814';
var split = desc.split("#");
//gs.info("Split Val/ues new"+split);
for(var i=0;i<split.length;i++){
gs.info("Main workflow Value "+split[i]);
workflow.scratchpad.rdmidVal = split[i];
'Gloss Error WF';
gs.info("RDMId Value in Main Workflow after calling workflow");
}
or
coordinator = new WorkflowCoordinator( {workflow:'Gloss Error WF'} );
for(var i=0;i<split.length;i++){
coordinator.add(
{ RDMID:'38954870'; // inputs to subflow ,you need to define input in the sub flow first to use this
// input2:'xyz',
}
);
}
coordinator;
know i want to set an scratchpad value in parent workflow and retrieve in sub workflow how can i achieve that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 01:06 AM
Hi
You set the value as workflow.name_of_variable ="someValue".
and retrive as var wfVar = workflow.name_of_variable;
Check this once and let me know.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 02:11 AM
Hi Omkar ,
i tried above solution but still am getting as undefined.
In parent workflow:
workflow.getData = "Welocome";
In Child Workflow:
var myname = workflow.getData;
gs.info("MY NAME GETDATA Values!@# "+myname);