Using a script include to create an action help please

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 06:50 AM
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:
- created input to hold the username (string)
- 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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 07:07 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2024 07:34 AM
Nevermind, I found my problem. I forgot the return statement in the script include for that function.