Viewed Service Portal pages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 05:01 AM
Hi,
I'm trying to use the Service Portal Log (sp_log) table to create a report showing how many times a page was consulted.
My pages contain a widget that dynamically load some content based on a sys_id parameter.
That's working fine, but it only counts the number of time a widget has been called independently of its content.
Example : myinstance.service-now.com/myPortal?id=myWidget&sys_id=123456789987654321
All what Service Portal Log catches is how many times myWidget was called. But I'd be more interested to know how many time the sys_id was called.
Hope that I had made myself clear.
Thankfully !

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 07:59 AM
Within the sp_log table, entries of Type "Task View" or "Catalog View" or "Catalog Request" (for example) all populate the ID field, which is the "sys_id" you specified.
Within the widgets, this is the line that does the logging:
$sp.logStat('Catalog View', data.sc_cat_item.sys_class_name, data.sys_id, data.sc_cat_item.name);
You can create a report that filters Type="myWidget" and then group by ID (although I would group by the Text field as it's more user-friendly).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 11:07 AM
Thanks Erik,
Yes, I had noticed what you mentionned, but unfortunatly our logs are of the "Page view" type, the one that doesn't fill the ID field.
We developped a simple widget that inserts manually in the sp_log table, and it works.
Thanks again !