How to get return value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 07:38 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:15 AM
But how would the script include know which is the wf?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:28 AM
I am not able to understand what you mean, can you elaborate your doubt?
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:33 AM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 09:27 AM
you would have defined the function right
say something like
function fucntionName(sysID){
// use sysID to glide
}
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 09:35 AM
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();