- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2017 05:47 PM
How does one get the sys_id of the current page that the user is viewing in the service portal?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2017 06:35 PM
Hi Scott,
My bad. I thought you were trying to retrieve sys_id from the URL.
You can try below code to get the sys_id of current page,
var page_id = $sp.getParameter('id');
var gr = new GlideRecord('sp_page');
gr.get('id',page_id);
var page_sys_id = gr.sys_id;
Hope this helps.
Do not feel shy to mark correct or helpful answer if it helps or is correct.
Best Regards,
Nitesh Asthana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 07:24 AM
How could I get this information from a global business rule? I want something to run only if the user isn't on a certain record producer within the service portal. I can't find the proper method. This isn't returning everything from the user logged in: gs.action.getGlideURI().getMap().toString();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2018 04:56 AM
Hi Blair,
Any specific reason for using Global BR to achieve this?
An alternative could be, create a custom widget and write your logic in the server side script field of the widget. Once created, add that widget to the page which you are using to display catalog items (default page is sc_cat_item). Whenever this page will load that widget script will be executed.
Let me know if it works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2018 08:32 AM
Hi,
I need similar functionality. I need to display the current page the user is on into the widget. How to achieve that?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2018 09:37 AM
Hi Blair,
You can access record producer or catalog item sys_id using $sp.getParameter() API.
Isnt' that working for you or you have some different requirement which I am missing here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2018 07:52 AM
Deepak - I was able to get help from HI on this. Here is the answer for getting the current page: How can I get the page a user is on in the Service Portal?