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.

How do I populate a field like gs.getUserID() does?

Shane J
Tera Guru

I'd like to build a Template to allow the auto-fill of Assignment Group from the User record, using a field called 'u_main_group' (similar to using javascript:  gs.getUserID()).  I've used Script Includes to limit options before, but never to populate a field like that.  

How would I do that?  Is that even the right approach?

1 ACCEPTED SOLUTION

SanjivMeher
Mega Patron
You can use the default field to set the assignment group. In the default field set JavaScript: var u = new GlideRecord('sys_user'); u.get(gs.gerUserID());u.u_main_group;

Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

6 REPLIES 6

With a minor typo fix, this does work:

 

javascript:var u = new GlideRecord('sys_user'); u.get(gs.getUserID());u.u_main_group;

small update: just to change the JavaScript to javascript