Table "sp_log" capturing the keyword entries, need to know the script doing this

pushkarganpule
Kilo Contributor

I am working on service portal. There is a search field on the portal home page. When user type any keywords in the search field. Their is one table[sp_log] capturing the keyword entries. I want to know which code inserting those Records to the table. I go through the widget script, but unable to found which script doing this. I want to implement same functionality in the customized search widget .

1 ACCEPTED SOLUTION

SatheeshKumar
Kilo Sage

Hi pushkar,

 

Currently we dont find any documentation from servicenow but you use the above suggested function to get the desired functionality.

check the atttached snapshot!!

Thanks,

Satheesh

 

 

View solution in original post

5 REPLIES 5

Paul Curwen
Giga Sage

According to serviceportal.io this does it: 

 

logStat(String type, String table, String id, opt String comments😞 voidCreate 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.

 

See: https://serviceportal.io/docs/documentation/widget_server_script_apis.md

 

 

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul