The CreatorCon Call for Content is officially open! Get started here.

How to get return value?

SNOW39
Tera Expert

Scenario 1: How can i get the return value in script include inside WF

scenario 2 : How can i send the sys_id of group create in WF to script include.

10 REPLIES 10

But how would the script include know which is the wf?

I am not able to understand what you mean, can you elaborate your doubt?

Best Regards
Aman Kumar

Say i am having the return sys_id in WF and i am creating a new script include and using the syntax below i would get the value in Script include?

 

new ScriptIncldueName().functionName(sys_id);

you would have defined the function right

say something like

function fucntionName(sysID){

// use sysID to glide

}

Best Regards
Aman Kumar

This aint working for me..

 

IN WF:

function x()

{

var groupGr = new GlideRecord("sys_user_group");
var groupname = current.variables.tester_group.getDisplayValue();
var sys_ids_tester;

groupGr.initialize();
groupGr.setValue('name', groupname);

groupGr.insert();
sys_ids_tester = groupGr.sys_id;

return sys_ids_tester;

}

 

In SI

 

createGroup: function(groupname,sys_ids_tester) {
var sys_ids;
var groupGr = new GlideRecord("sys_user_group");
if (!groupGr.get('name', groupname)) {

groupGr.initialize();
groupGr.setValue('name', groupname);

groupGr.insert();
sys_ids = groupGr.sys_id;

} else {
sys_ids = groupGr.getUniqueValue();
}

// inserting in custom table

 


var groupGre = new GlideRecord("u_bu_extdata");

groupGre.initialize();


groupGre.setValue('u_devgroupname', sys_ids);

groupGre.setValue('u_testergroup', sys_ids_tester);



groupGre.insert();