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

Ajaykumar1
Tera Guru

Hi you can also create variables from  Workflow Action > Edit Inputs // refer the attached screenshot

Create variables as required and to pass values from Parent WF to Child WF follow the steps in Pass a variable from a workflow to a subflow

find_real_file.png

Mark if correct/helpful.

Regards,
Ajay

Anirban Roy
Mega Guru

Hi, 

Though this is an old post, sharing some relevant information for your query, if it helps.

 

1. You may not be able to use add inputs option in your case, since your table is 'sc_req_item'

Please find below screenshot from Servicenow docs.

find_real_file.png

 

2. You may use run script to trigger the sublow -

var wf = new Workflow();
var workflowId= wf.getWorkflowFromName('name of the wf');

if (workflowId) {
var varObj= {};
var context = wf.startFlow(workflowId,current,current.operation,varObj);
}


 Regards,

Anirban

Android
Tera Contributor
شكرا الان بداء الاستجابة لكل البرمجة