How do you use a script include in Flow Designer

JohnM2
Kilo Contributor

Hey everyone,

I am currently trying to call a script include in a script action as part of my flow.  However, when I do this using the 

var foo = new ScriptInclude();

It gives me an error saying that the "ScriptInclude" is not defined.  Is there a special way of using a script include in flow?  Any advice is awesome.

Thank you,

John

12 REPLIES 12

Smriti Rastogi
Kilo Guru

you should use the api name of the script include when calling from flow.

matthijsoomen
Giga Guru

Hi John,

 

 

Not sure if you still have this issue.

But I had the same issue, and in the end I was able to solve it by deleting the specific Flow action, and rebuilding it.

The second time it was working fine.

This might help for you as well.

 

Kind regards,

Matthijs

 

Radek
Tera Expert

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