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 convert Script from workflow to flow designer custom action script

Divya57
Tera Expert

Hi All,

I got a requirement to convert workflow into flow designer. Am facing one challenge on converting run script from workflow to flow designer. Can someone please help me out.

I have below run script:
var getdesc = current.description.toString();

var rp = getdesc.replace(/[^\x00-\x7F]/g," ");

var sp = rp.split('\n');

var l;

var lines = 0;

var Text = 'New Task';

for(i=0; i < sp.length; i++){

if(sp[k].indexOf(Text) > -1){

lines = i;

}

}

l = a.split('New Task URL: ')[1].split('\n')[0].trim();

current.variables.u_task_name=l.replace(/  +/g, ' ');

 

l = a.split('New Company: ')[1].split('\n')[0].trim();

current.variables.u_company_name=l.replace(/  +/g, ' ');

 

l = a.split('New Address URL: ')[1].split('\n')[0].trim();

current.variables.u_address_name=l.replace(/  +/g, ' ');

The above script is working fine in workflow. I need to convert this script from workflow to Flow designer. I know using Flow designer custom script action we can do it. can someone help me out how to do that ?
Thanks

 

 

 

5 REPLIES 5

OOB there is (currently) no way of setting values on Flow Designer (catalog item) variables,

but there is a workaround you can use as per this article by Maik Skoddow.

See if you can make use of it.