Using a script include to create an action help please

Community Alums
Not applicable

I have a script include I created called OffboardingUserUtil that has functions in it that will list of tasks, or software they they own. 
i'm trying to put this into an action but it's not returning anything for the user.  I have ran it in background script and it works as expected but the action is not returning anything.
I use variable x to keep it simple and will rename the variables after it's working.

 

I have done the following:

  1. created input to hold the username (string)
  2. added a script step that shows the following that in theory should return values (as it does when run in background scripts).

 

(function execute(inputs, outputs) {

///get the username from the inputs
var x = inputs.username;

	var scriptInc = new OffboardingUserUtil();
	var x = scriptInc.getSoftwareOwner(x);

//output
outputs.mylist = x;

})(inputs, outputs);
​

 

  • I have Output and have those mapped. to mylist (string) 

I don't get any results returned.  If I run the var x -> to the outputs in background script it returns results. 
What could I be doing wrong?

2 REPLIES 2

Bert_c1
Kilo Patron

You will need to use GlideAjax in a client script to call methods in a script include. There are plenty of examples in your instance.  And post the type of client script and script include, so folks here can assist you.

Community Alums
Not applicable

Nevermind, I found my problem.  I forgot the return statement in the script include for that function.