A widget getting it's own id or sys_id

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 12:39 PM
In "Server Script", trying to get a widget's own sys_id.
There's no such thing as $sp.getUniqueValue()
What would be it's equivalent?
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 02:34 PM
I assume you mean you want the instance sys id. If not you can probably gliderecord to it from there.
https://blog.jacebenson.com/sp/#getinstancerecord

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 04:32 PM
Nope, I don't mean instance sys id. I literally mean the sys_id of the widget itself.
Not sure what you tried to link but our company is blocking whatever site you linked.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 04:38 PM
I am not sure if the function is documented. I linked to my blog where I keep a personal list of all the methods I’ve seen/used. Anyways from the instance it should just be a reference to the widget.
// Returns the widget instances GlideRecord.
// source: Icon Link[3caa67afcb13020000f8d856634c9c2e] line 2
var gr = $sp.getInstanceRecord();

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2018 05:14 PM