Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

\$sp aka GlideSPScriptable documentation lacking

Jace Benson
Mega Sage

So I'm trying to figure out specicially some things about;

$sp.getKBCount()

$sp.getKBCategoryArticles();

The only methods documented today on https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=c_GlideSPScriptableScopedAPI are;

$sp.canReadRecord

$sp.getCatalogItem

$sp.getDisplayValue

$sp.getField

$sp.getFields

$sp.getFieldsObject

$sp.getForm

$sp.getListColumns

$sp.getMenuHREF

$sp.getMenuItems

$sp.getParameter

$sp.getPortalRecord

$sp.getRecord

$sp.getRecordDisplayValues

$sp.getRecordElements

$sp.getRecordValues

$sp.getStream

$sp.getValue

$sp.getValues

$sp.getWidget

Missing so far;

$sp.getKBRecord

$sp.getKBCount

$sp.getKBCategoryArticles

$sp.getKBTopicArticles

$sp.getKBTopCategoryID

$sp.getKBSiblingCategories

$sp.showCatalogPrices

$sp.saveVariables

$sp.buildThemeVariableModel

$sp.getVariablesArray

$sp.getWidgetFromInstance

$sp.getRecordVariablesArray

$sp.getFilterBreadcrumbs

$sp.logStat

$sp.getInstanceRecord

$sp.log

$sp.saveRecord

$sp.logSearch

ctomasi bianca.vaccarini any update on when these will be documented would be appreciated.

1 ACCEPTED SOLUTION

I don't use the widget editor as it's not my preference. But many times when I come across a method for portal that I need more info on how to use it, I go to the widget editor. There is some built-in documentation on many of the methods that show you what it will return and in what cases. It also shows you what parameters it accepts if you type all the way out to the parenthesis.



widgetEditorUsage.png


widgetEditorUsage2.png


View solution in original post

8 REPLIES 8

Gaurav Bajaj
Kilo Sage

Hi Jace,



As per my knowledge,


  1. $sp.getKBCount()   - gives the Kb article count from the KB base selected on the portal you are using.
  2. $sp.getKBCategoryArticles();   - gives the category of Kb base selected on the portal you are using.



find_real_file.png


I looking for the specific query its doing.   Is it just querying the kb_knowledge table or the many to many kb_category to kb_knowlege, does it include today in valid_to or not?   Without official documentation, and without some testing, these questions at best are guesses.



I do appreciate your response gauravbajaj2007, but I just need more than an educated guess.


Hi Jace,



I understand your concern with the documentation but we can surely give them a shot and find the underlying feature it has been holding.


As per what I tested, it returns KB glideRecord object based on the category you are passing, It doesn't put a restriction on the valid_to.



find_real_file.png


I just don't want start using something only to have it "taken" away like packages or other deprecated calls.