SakshiArora
Giga Contributor

Hi,

We can use variable to run Glide Record by passing the table name as variable.You can see the below code as an example:

function onLoad() {
var count = 0;
var table = 'incident';
var gr = new GlideRecord(table);
gr.addQuery('priority',1);
gr.query();
while(gr.next())
{
count = count + 1;
}
alert(count);
}

I have tried this and it is working in onLoad Client Script.. I hope you are looking for the same.