How to pass the scratch pad variable to the sub workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 08:40 AM
Hi All,
I am having one workflow and this workflow uses one sub workflow.
I have using one scratchpad variable every where in the main workflow but i can't able to access the scratchpad variable in the Sub workflow.
How should i access or pass the scratchpad variable to the sub workflow.
Thanks
Venkatesh Dhanapal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 09:04 AM
hi Venkatesh,
Scratchpad variable in main workflow can be used in Subflow. Please follow the steps in the url mentioned below:
Hope this helps.
Thanks,
Manik
PS: Please mark helpful, correct or like if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 09:05 AM
Ti pass from parent to child, child wf must have input variables defined
You can return an object from the subflow to the parent.
Create scratchpad object in Run Script :
- workflow.scratchpad.my_obj = {};
- workflow.scratchpad.my_obj.myVarOne = "Hello";
- workflow.scratchpad.my_obj.myVarTwo = "World";
Use ${workflow.scratchpad.my_obj} as the single return value from subflow. And then you can call the properties from the parent by using whatever you called the return value like:
- workflow.scratchpad.returnedVal.myVarOne; // "Hello";
- workflow.scratchpad.returnedVal.myVarTwo; // "World";
use the return (y) inbuilt WF activity to fetch the values in parent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2017 09:07 AM
This link might be helpful for you
http://wiki.servicenow.com/index.php?title=Using_the_Workflow_Scratchpad#gsc.tab=0