\$sp.getParameter("sys_id") returning "null" value in Service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2016 09:01 AM
I am using $sp.getParameter("sys_id") in widget ,but it retun null,
anyone can help on this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 12:31 AM
I'm having the same problem with $sp.getParameter("xxxx") too.
It's not just the "sys_id", I'm finding that all GET vars in the URI when the record watcher refreshes the Model/Server Script for that Widget are NULL.
I hope someone has a work around, anyone? Also does anyone have access to HI, as this might actually be a bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 03:17 AM
It seems Scott is right based on the gitHub issue comment:
Here is the comments on the unofficial github documentation:
$sp.getParameter() does not currently work within embedded widgets. I am not sure if it is coming in a future patch or not.
What you can do to get these parameters in an embedded widget is to pass them in as either input, or options into the embedded widget. The recently updated embedded widget documentation explains how to provide options or input to en embedded widget.
Hope this helps.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 03:44 AM
My issue isn't directly related to embedding widgets. However, I think if you use a watcher on that embedded widget you'll find the same issue as me and I don't think that the input or options will work, because as soon as the watcher runs, it only runs the model, while ignoring any data built within the controller, thus deleting it from the view. Is this another "undocumented feature", or is this "working as expected"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 04:14 AM
I don't know, you probably should raise an issue in the github for more info.