- 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
ā01-31-2023 08:17 PM
If your workflow is on RITM table, you can access variables as below
var variable1 = current.variables.variable_name;
//Pass the above variable as a parameter to script include function
var passVariable = new scriptIncludName().functin(variable1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-31-2023 08:37 PM
In script include there is variable
var abc = gef[1];
var x = function (){
return abc;
};
In workflow run script
var def = new script_include().x();
I am trying it but not achieved results
- 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-03-2023 12:45 AM
Awesome it's working now