Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Gliderecord in reports

Vivek Bala - VB
Kilo Contributor

Hi, am new to servicenow, am working on reports module. I need to know where I can write a gliderecord query to fetch the data..? Revert to this query is much appreciated. Thanks in advance

6 REPLIES 6

sergiu_panaite
ServiceNow Employee

Can you detail a bit what exactly you want to achieve?



Regards


Thanks for ur reply.. i need to fetch a record from incident table using gliderecord query. I don wanna go to reports module by doing manually. How can I achieve this.. Pls help me..


Like this:


var gr = new GlideRecord('incident');


gr.addQuery('number', 'INC123456');


gr.query();




while(gr.next()){




  //do something


}


Regards


Anurag Tripathi
Mega Patron

I did something similar, hope it helps you too



My Scenario: Pull all incidents where assignment group is any of the groups i am member of(some users are members of many groups).


Solution :


Create a dynamic filter, which will call the script include and there you can write your glide record.


In the report add the filter like:


<assignment Group> <Is Dynamic><The Dynamic filter you created>


-Anurag