Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to pass variables from parent workflow to child workflow

arey yaar
Giga Guru
i created two work flows one is the parent and the other is the child for the parent, and in catlog item i have 2 fields. i need to pass the values from 1st field to 2nd field using workflow pass a variable.

i need to pass the value from test1 to test2

find_real_file.png

first workflow

find_real_file.png

2nd workflow

find_real_file.png

find_real_file.png

Where did i go wrong

17 REPLIES 17

even i too have the same problem , i tried the above link but didn't work

Hi,

can u included child workflow in parent using sub flow activity?

 

 

Thanks and Regards,

Apurva Malewadikar

www.DXSherpa.com

no i need to create separate Two workflows separately as mentioned above 

no i should not use subflow activity rather i need to work with two workflows which acts parent and child

Steven Parker
Giga Sage

In your example, the 2nd workflow called "varchar", you need to check it out and add workflow inputs to that workflow in ther workflow properties.  Here is an example of a subworkflow (child workflow) we are using and the inputs on it:

find_real_file.png

 

Then, we you open the child workflow inside the parent workflow, it will look like this:

find_real_file.png

In the above screenshot you can see how to pass variables to the child workflow.  You use scratchpad variables.

So in your parent workflow, you would have a run script that has something like this in it:

workflow.scratchpad.userid = current.text1 //this will set the text 1 field data to a scratchpad variable, which you can then pass to the child workflow inputs

 

 


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven