gs.getUser().getUserByID() in a URL sysparm

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 08:47 AM
Anybody know if gs.getUser().getUserByID works in a URL sysparm for a new record form?
I have:
sysparm_query=caller_id=javascripts:gs.getUser().getUserByID(userid)
But it's not returning properly. Any ideas?
[edit: corrected url]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 08:59 AM
Hello Earl,
You can try adding "javascript" before the gs.getUserID:
<table_name>.do?sys_id=-1%26sysparm_query=caller_id=javascript:gs.getUserID()
You can see further details here:
Navigating by URL - ServiceNow Wiki
Hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 09:02 AM
actually, i mis-typed. I do have javascript before it. it still doesn't work. and I've reviewed the wiki before but it doesn't get into user objects past "getuserid"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 09:10 AM
You are right, I played a little bit with that in my instance, but just as you said, it doesn't seem to be able to dot-walk the object, other methods like getProperty() didn't seem to work either...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 09:25 AM
called_id=javascript:gs.user_id()
ysparm_query=caller_id=active=true^caller_id=javascript:gs.user_id()