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 run Workflow from Transform Map import set? for 200 records in excel file

DIVI1
Tera Expert

Hi, 
I need to run transform map for 200 records in requested items table, and also I need to run for them specific workflow where I have 14 tasks for each of them. So where should I put a script and how the script should looks like? 

for now I just tried to run Workflow using just "StartFlow" like below:

var wflw = new Workflow();
wflw.startFlow(wflw.getWorkflowFromName('SAP RITM Integration'), current, 'insert');

unfortunately it's not working.

 

find_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you should be using onAfter transform script for this

OR

in your script update the current object with target

var wf1 = new Workflow();

wf1.startFlow(wf1.getWorkflowFromName('SAP RITM Integration'), target, 'insert');

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you should be using onAfter transform script for this

OR

in your script update the current object with target

var wf1 = new Workflow();

wf1.startFlow(wf1.getWorkflowFromName('SAP RITM Integration'), target, 'insert');

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

It's working, didn't think about that, Thank you 😉

Hi Ankur, What is the target table for workflow is it "wf_workflow"