- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 02:57 AM
Hi,
I have created a script include which has 3 functions. Two functions return a list (array of sys_id).
I need to use the return value of the 2 functions in the 3rd one for gliding some record.
Can anyone tell me how to use the value of 2 function in 3rd one
Regards,
Deepshikha
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 03:28 AM
Hi,
you need to call those 2 functions in 3rd function like this
the syntax of calling function within script include is
this.functionName()
Example below
var GetGroupMembers = Class.create();
GetGroupMembers.prototype = {
initialize: function() {
},
getUsers: function(){
},
getMembers: function(){
},
thirdFunction: function(){
var firstArr = this.getUsers();
var secondArr = this.getMembers();
// now use these 2 arrays
},
type: 'GetGroupMembers'
};
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 03:28 AM
Hi,
you need to call those 2 functions in 3rd function like this
the syntax of calling function within script include is
this.functionName()
Example below
var GetGroupMembers = Class.create();
GetGroupMembers.prototype = {
initialize: function() {
},
getUsers: function(){
},
getMembers: function(){
},
thirdFunction: function(){
var firstArr = this.getUsers();
var secondArr = this.getMembers();
// now use these 2 arrays
},
type: 'GetGroupMembers'
};
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 03:44 AM
Thanks!! its helped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 03:52 AM
Hi
Use this syntax to call function into script include.
this.functionname();
Please mark reply as Helpful/Correct, if applicable. Thanks!
regards,
Rameshwar Khile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 04:18 AM
Again a repeat
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader