Error with calling script include in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2022 01:12 AM
I have a script include with this syntax
var testScriptInclude = Class.create();
testScriptInclude.prototype = {
initialize: function(currentObj) {
this.currentRecord=currentObj;
},
generateDataFields:function(){
var fields = {
'dataone':'',
'datatwo':''
}
// some logic to populate data1 & data2
return fields
I am calling this in inline script in flow designer -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2022 02:52 AM
I had this idea of using custom action as a last option.
But odd how the inline script did not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2024 02:49 AM
Hi, had the same issue in Vancouver - undefined, new global.NameOfScriptInclude()
it turned out - if it's under if condition than it's undefined..
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0791144
Workaround:
1. define flow variable in the body of the flow + use the script include (I haven't tested subflow which could be used as well)
2. use the defined flow variable in the action