- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Do you know how to call a script in the reports and why?
There are multiple scenarios which we can not perform by the simple filters in the reports.
Example: Show all the survey response questions if response of First Question is Positive.
In this conditional requirement we can not achieve the complete data in the report so we can call the script Include in the Report as below.
Script Include:
getAllSurveyResponse: function() {
var ans =[];
var result = new GlideRecord('asmt_assessment_instance_question');
result.addEncodedQuery('category=c8f4ab6a0fe57a0006e25c3be1050ebb^sys_created_onONLast month@javascript:gs.beginningOfLastMonth()@javascript:gs.endOfLastMonth()^metric=53eea7a0db8f57cc4f5bf64a0c9619fb^value=1^ORvalue=2');
result.query();
while(result.next()){
ans.push(result.getValue('instance'));
}
return ans.toString();
},
Report:
If my content helped you in anyway, please mark this content as BOOKMARK, SUBSCRIBE & HELPFUL
Best Regards,
Prashant Kumar (LearnIT)
YouTube Channel LearnIT: https://www.youtube.com/@learnitwithprashant
Blog LearnIT: https://medium.com/@LearnITbyPrashant
Prashant Kumar LinkedIn: https://www.linkedin.com/in/learnitbyprashant/
ServiceNow Community Prashant Kumar - https://www.servicenow.com/community/user/viewprofilepage/user-id/19635
- 4,327 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
