A widget getting it's own id or sys_id

xiaix
Tera Guru

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

Jace Benson
Mega Sage
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

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.

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();

Well, that let me to this:

find_real_file.png

 

Which is exactly what I needed.