Unable to find gs.action documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 05:16 AM
I would like to know which object is returned by the call "gs.action" or "gs.action.getGlideURI()" to understand what I can do with such objects, but I cannot find any documentation about these calls. I just discovered some calls examples in the community. Can anyone please let me know where I can find a documentation about "gs.action".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 06:02 AM
Sadly there isn't any official documentation about it. Otherwise it would show up on developer.servicenow.com
This is about what I know: What is "gs.action"?
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 06:16 AM
Thanks a lot Goran for your answer. I could never imagine that "gs.action" could have all these available calls without having them in the official API documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2021 12:15 PM
It looks like they may have documented it over the past four years.
https://developer.servicenow.com/dev.do#!/reference/api/orlando/server/no-namespace/ActionAPIBoth
As near as I can tell, gs.action is the same as the globally (or top of scope) var "action" that is set under some conditions when the user triggers an action, usually via a button. Most likely, if you have a gs.action, there is probably also an action. And if you are expecting gs.action in a business rule, you are likely throwing a null pointer error when it doesn't.
gs.action.getGlideURI() would be the same thing as action.getGlideURI() in those cases, and when an action is not underway, you would throw a null point back into the invoking rhino / java.
Typically what people seem to want is either new GlideURI() which returns the same thing as gs.action.getGlideURI() or just action within the context of a scripted ui action.