- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 01:11 PM - edited 02-02-2024 01:12 PM
Hello,
I have tried getting the KB sys_id from a widget on the portal. I have tried different ways of doing so.
1.
var kbSysID = $sp.getParameter("sys_id")
// this returns null
and
2.
var page_id = $sp.getParameter('id');
var spPage = new GlideRecord('sp_page');
spPage.get('id',page_id);
var page_sys_id = spPage.sys_id;
// this returns undefined
Neither way works. Is this related to versioning on KBs? Can someone please help me figure this out?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 05:17 PM
Hi @Jalen Dixon in that case you need to use below
var kbSysID = $sp.getParameter("sys_kb_id");
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 10:36 PM
Hi @Jalen Dixon the portal page you open, does the url contain sysid or KB number?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 07:42 AM - edited 02-05-2024 12:40 PM
Yes, it says "sys_kb_id=sys_id". @Harish KM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 05:17 PM
Hi @Jalen Dixon in that case you need to use below
var kbSysID = $sp.getParameter("sys_kb_id");
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 06:42 PM
Hello @Jalen Dixon ,
if your URL is in below format
instance/kb?id=page_id&sys_kb_id={sys_id}
then $sp.getParameter('sys_kb_id') gives the value of sys_id from the URL. So you have to use
var KbSysid =$sp.getParameter('sys_kb_id')