Script include in workflow

servicenow14710
Tera Expert

How to get retrun value of script include function in workflow.Any help is appreciated,Thanks!

6 REPLIES 6

Maddysunil
Kilo Sage

@servicenow14710 

Sample script below to collect return from script include:

 

var input = current.something; // Set your input value here
var result = new MyScriptInclude().myFunction(input);

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

Hello @Maddysunil : if there are no parameters in my function, can the above script works? As i used the same and it is not working, Thanks!

@servicenow14710 

If there is no parameter then just use:

 

var result = new MyScriptInclude().myFunction();

 

Note: Replace script include name with your actual script include and function name

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

Yes i used the same and i m returning count from this script include but in workflow the count always shows as 0. Thanks!