server script to retrieve Country information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 12:05 AM
In order to get user information to be displayed in the header of a portal, you can use the glidesystem user object:
eg. gs.getUser().getFirstName;
This works fine if the field contains a value. However if the field is a reference, then the gs doesn't return a value :
eg. gs.getUser().getLocation; doesn't return the value of the location of the logged on user.
Is there a way to get the value from a reference field ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 12:07 AM
you can use this
javascript:gs.getUser().getRecord().getDisplayValue("location");
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 02:04 AM
Thanks Harish, this indeed works.
Do you also know how to get the country value ? (from the reference location => Country)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 02:56 AM
The variable is referenced to location table or country table?
if country you can do this
javascript:gs.getUser().getRecord().getDisplayValue("country");
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 05:57 AM
the country value is located in the location table, which is referenced in the user table.
Your suggestion doesn't work.
So it is dot walking a level deeper.