error in script

Ketan Pandey
Tera Expert

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,

4 REPLIES 4

Ketan Pandey
Tera Expert

error 

Can not find the function join in object sdjgadjasgjdgasjdg343gjsdsdas,dkfjkdhjkfbsdjk2dfdqwsdssd

Ankur Bawiskar
Tera Patron
Tera Patron

@Ketan Pandey 

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(','));

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thank You Ankur, I am still getting the error

 

Error 

Can not find the function join in object sdjgadjasgjdgasjdg343gjsdsdas,dkfjkdhjkfbsdjk2dfdqwsdssd

 

 

Harish Bainsla
Tera Sage
Tera Sage

function filter(arr1, arr2) {
return arr1.filter(function(arg1) {
var gr = new GlideRecord("register");
gr.addQuery('skill', arr2.join(',')); 
gr.query(); 
return gr.hasNext(); 
});
}