How to pass values from a from to a workflow that is inside another workflow

rocktheboat
Giga Contributor

How to pass values from a from to a workflow that is inside another workflow.

Thanks for your answer.

1 ACCEPTED SOLUTION

ashwinkumar_pat
Giga Expert

! !Hello Som,



Here is the documentation on how to do that.



1. Define inputs on the subflow - Define inputs for a subflow


2. Pass inputs from main workflow to subflow - Invoke a subflow in a workflow



Here is an example -



This example simply passes the value of short description field on incident form to a subflow. The subflow then copies the value of short description over to description field.



find_real_file.png




find_real_file.png




Step 1 - Create an input variable in subflow of type string and label it as short des


find_real_file.png



Step 2 - Add a run script to read the input variable in subflow


find_real_file.png




Step 3 - Drag and drop the subflow in main flow. You will get a dialog where you need to set the value of input variable you created in subflow in step 1.



find_real_file.png



Let me know if you need any additional info on this.


View solution in original post

6 REPLIES 6

ashwinkumar_pat
Giga Expert

! !Hello Som,



Here is the documentation on how to do that.



1. Define inputs on the subflow - Define inputs for a subflow


2. Pass inputs from main workflow to subflow - Invoke a subflow in a workflow



Here is an example -



This example simply passes the value of short description field on incident form to a subflow. The subflow then copies the value of short description over to description field.



find_real_file.png




find_real_file.png




Step 1 - Create an input variable in subflow of type string and label it as short des


find_real_file.png



Step 2 - Add a run script to read the input variable in subflow


find_real_file.png




Step 3 - Drag and drop the subflow in main flow. You will get a dialog where you need to set the value of input variable you created in subflow in step 1.



find_real_file.png



Let me know if you need any additional info on this.


Thanks so much Ashwinkumar!


I actually have a out of the box workflow, which has a sub-workflow. I want to assign the values to sub-workflow from the form.


What is the best way to do it. Thanks again!


I was just able to work it out. (actually the form was missing value, dhu)



in the sub-workflow that is what worked well for me (in advance script section).



task.columnName = current.columnName;



Ex.


task.assignment_group = current.assignment_group;



Reference:


http://wiki.servicenow.com/index.php?title=Using_Variables_in_a_Workflow#gsc.tab=0



Thanks Ashwinekumar for your answer. It is the correct answer to the initial question I asked.


If I've answered your question, please mark the response as correct (not just helpful) so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   Please review How to Mark Answers Correct From Inbox View.