- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2023 07:41 PM
Hi,
I have a script include and there is a value stored in the variable and I have to access that value from workflow run script then how can I access that value? Please help me on this
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2023 09:19 PM
Try this
var myScript = { //myScript - script include name
getValue: function() {
var abc = gef[1];
return abc;
}
};
// In your workflow script
var myIncludedScript = gs.include('myScript');
var value = myIncludedScript.getValue();
gs.info(value);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-02-2023 07:27 AM
//In the script include define function as below
functionName : function (){
var abc = gef[1]; //variable
return abc;
};
//In workflow run script, pass the script include name along with function name
var def = new script_include_name().functionName();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2023 09:25 PM
Hi @ak48 ,
You want the variable present in Script include to be passed to workflow?
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2023 09:31 PM
Yes I want to pass value from script include to workflow run script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2023 11:01 PM
You can pass the values as input to the workflow, you might be triggering the workflow from script include, there you need to pass. Something like this
var wf = new global.Workflow();
var wfId = wf.getWorkflowFromName("workflowName");
var temp={};
temp.input1="input1";
temp.input2="input2";
var context = wf.startFlow(wfId, null,null,temp);
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2023 09:58 PM - edited ā01-31-2023 10:02 PM
Hello,
Try like the below
var x = function (){
var abc = gef[1];
return abc;
};
Refer the below link.
Regards,
Namrata