- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2019 04:46 AM
in service portal
i have a page with one widget
the server script on the widget needs a sysid
i thought i could put the sysid in the url
and retrieve it in the server script on my widget, like so:
my url is: myservicenow.com/sp?id=mypageid&sysparm_my_sysid=1111111
>> sp?id=mypageid this is the id of my sp page
server script:
function($sp){
var sysid = $sp.getParameter('sysparm_my_sysid');
gs.info(sysid);
}
this is not working.
i have looked at documentation and community posts ... i am not sure if i am doing this correctly.
help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2019 06:21 AM
You don't need to declare $sp, it's built in. Here's an example of the start of one of my scripts that I use a couple URL parameters...
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
var cardID = $sp.getParameter('card_id');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2019 06:21 AM
You don't need to declare $sp, it's built in. Here's an example of the start of one of my scripts that I use a couple URL parameters...
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
var cardID = $sp.getParameter('card_id');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2019 06:59 AM
omg, it was that simple 🙂
i removed $sp from function and voila!
