error in script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:19 PM
I have a custom table, which has list type field.As you know ,List field contains the sys_id only.
I have written the script which has a method which takes the two argument ,which must be of array type.
function filter(arr1,arr2)
{
return arr1.filter(function(arg1)
{
var gr=new GlideRecord("register");
ga.addQuery('skill',arg2.join(',')); // Error coming for this line .join is not method of object
gq.query();
return ga;
}
)
}
The problem i am facing is that , its throwing the error,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:33 PM - edited 08-29-2023 11:34 PM
error
Can not find the function join in object sdjgadjasgjdgasjdg343gjsdsdas,dkfjkdhjkfbsdjk2dfdqwsdssd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:39 PM
what's your business requirement?
it would be nice if you share that along with detailed script
try this once
ga.addQuery('skill', 'IN' ,arg2.join(','));
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:54 PM
Thank You Ankur, I am still getting the error
Error
Can not find the function join in object sdjgadjasgjdgasjdg343gjsdsdas,dkfjkdhjkfbsdjk2dfdqwsdssd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:57 PM
function filter(arr1, arr2) {
return arr1.filter(function(arg1) {
var gr = new GlideRecord("register");
gr.addQuery('skill', arr2.join(','));
gr.query();
return gr.hasNext();
});
}