- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2017 02:54 PM
I have a script I want to execute depending on if the answer for a script include returns true or false. I invoke the script include at the beginning of my script and want to add if "if/else" statement to decide wether or not the script should execute. How can I do this?
(Script I want to execute if script include returns true)
(Script include)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2017 03:10 PM
Hello Josh,
var slack = new SlackUser();
var res = slack.activeUser(); //This would return true or false depeding on the output from Script include.
Please let me know if you have any questions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2017 04:45 PM
Line 13 to 21 in your code is not necessary.
Consider simplifying:
gr.query();
return gr.hasNext();
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022