Populate the Logged in Users location in condition builder

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2018 12:56 AM
Hi,
I want the location of logged in user in below condition builder:
For this I have used following script:
1. javascript:gs.getUser().getRecord().getDisplayValue('location'); >> It is showing error "Error Message
var location = gs.getUser().getRecord().getDisplayValue('location');
return location;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2018 01:04 AM
Hi,
You can use dynamic filter as shown in the attached screenshot.
Thanks
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2018 01:11 AM
Hello Keyur,
You can use something like this:
javascript: gs.getUser().getLocation()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2018 01:14 AM
Hi,
Are you looking for the location of logged in user or his country name in your condition?
If you are using display value, then you will get location's name and not the country which is why you won't get anything.
If you are looking for the country only, then you might want to change the script include to point out the country and return it.
function myLocation1(){
var gr = new GlideRecord("sys_user");
gr.get(gs.getUserID());
var country=gr.location.country;
return country;
}
Please mark it correct/helpful based on the response.
Thanks
Gaurav