Passing a variable value from subflow to Parent Flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 07:51 AM
Hello All, I need to pass variable value from "sub-workflow" to "parent-workflow".
Can anyone help me in achieving this.
Thanks!
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 07:55 AM
Hello,
You would use "return value" for this.
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 02:59 PM
Hi Allen,
Thanks for your response! I have following questions
1. Should the variable(the value I am trying to return to Parent flow) should be on the Parent workflow.
2. Where exactly I need to put the "Return Value" in the subflow workflow.
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 03:32 PM
Hello,
In your subflow when you place that on your parent workflow, there's a popup window that has a field that says: Map return value to -- so you can specify a scratchpad variable here using something like: workflow.scratchpad.subflow_result
Then use the return value workflow activity to set that value:
So you'd use that and then in your parent workflow, you can access it by using:
workflow.scratchpad.subflow_result
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2020 03:42 PM
Hi,
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";
If i was able to solve your query, please mark my answer correct and helpful.
Thanks & Regards
Prasant kumar sahu