Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

eduque
Giga Expert

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]

9 REPLIES 9

carlosloza
Kilo Expert

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


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"


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...


called_id=javascript:gs.user_id()



ysparm_query=caller_id=active=true^caller_id=javascript:gs.user_id()