- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 05:59 AM
Hi All,
I have created an external search source,but, since it's a customized search and facet, the system does not log search entries in the sp_log table. We shall use GlideSPScriptable function to capture the search text and create such log entries.
Can anyone please help. It is part of the Simulator that I'm practicing from the NowLearning platform. Please refer to 'Service Portal (London)' Simulator for the exercise.
Thanks & Regards,
Rajalakshmi.
Solved! Go to Solution.
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 03:02 AM
above method can be used only inside widget client script.
may be you can do normal glide record insertion into sp_log table. with required values.
you can get the search term from "query" in data fetch script section of your search source.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 05:31 PM
you can use the below:
$sp.logStat(String type, String table, String id, opt String comments);
logStat(String type, String table, String id, opt String comments😞 void | Create a new entry in the sp_log table with a table name, a record sys_id from that name, and some type and optional comments. Handy for doing things like logging searches or visits to pages, etc. |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 09:42 PM
Hi
Can you please help me where I have to place the code. I am using an external search source which is scripted.
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2019 03:02 AM
above method can be used only inside widget client script.
may be you can do normal glide record insertion into sp_log table. with required values.
you can get the search term from "query" in data fetch script section of your search source.