How to access a record's URL in UI Action

ywen
Kilo Contributor

We have a requirement of conditional logic in a UI Action.   I'm trying to pass in the application state via a custom query parameter in the record's URL.   For example the portalmode parameter below:   (blahs in place of sys id)

/sysapproval_approver.do?portalmode=yes&sysparm_view=ess&sys_id=blahblah

However when I use gs.action.getGlideURI() (following this solution https://servicenow-pub.hosted.jivesoftware.com/thread/222681 ) in the UI Action script, the string I get back does not match the parameters I passed to the record.   I'm getting back sysparm_tiny=blahblahblah

What am I doing wrong?   Thanks

5 REPLIES 5

ywen
Kilo Contributor

I ended up not using the server-side API to read URL parameters.   I re-designed the solution to leverage sysparm_stack parameter to force a redirect, which also worked for the problem I had.   Thanks all!