Getting user location from user table via glide record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 08:41 AM
Hi ,
I have to call script include after getting user location from user table via glide.
Kindly help me with script .
PS : I have to call assignment lookup script include which will assign a group based on user location taken from the user table
Thanks in advance
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 08:46 AM
scriptIncludeName(current.user.location) would work if you have the user field as a reference on the table.
var user = new GlideRecord('sys_user');
user.get('<sys_id of the user>'); // or user.get('user_name', '<user id of the user>');
scriptIncludeName(user.location);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 09:14 PM
Hi Mike,
It is showing undefined on background script .
I tried this :
var user = new GlideRecord('sys_user');
user.get('2892312d4f1f3200da95e9628110c79e');
gs.print(u_AssignmentLookup(user.location));
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 10:13 PM
Hello Sneha,
Updated code:
var user = new GlideRecord('sys_user');
user.get('2892312d4f1f3200da95e9628110c79e');
gs.print( new u_AssignmentLookup(user.location));
Please try this and let us know if you are blocked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2017 12:22 AM
Hi Sneha,
Good Day
Please find the updated script below for your reference :
var user = new GlideRecord('sys_user');
user.get('2892312d4f1f3200da95e9628110c79e');
var assignmentGroup = new u_AssignmentLookup(); /*calls the script include*/
var result = yourFunctionName(user.location);/*calls the specific function by passing the location of the user in the parameter*/
Hope it will helps you out!
PS: Hit like, Helpful or Correct
Thanks,
Priyanka R