- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2015 03:48 AM
Hi,
Can any one tell me how to get the display value of a Glide list from a client script?
Thanks in advance!!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2015 07:43 AM
This should work. Just replace 'watch_list' with the name of your field.
var fieldName = 'watch_list';
var options = $(g_form.getTableName() + '.' + fieldName + '_nonedit').innerHTML;
alert(options);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 08:29 AM
Thanks Mark. I'm trying to capture the list values as the user is changing them, and then take action using a client script. However, $(g_form.getTableName() + '.' + fieldName + '_nonedit').innerHTML only gets the values that were first loaded with the form, not the new ones that the user is selecting.
Is there a way to get the new values? Without having to use AJAX or some kind of server-side code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2015 04:41 AM
Thanks a lot Mark, it worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 04:56 AM
Hi Mark,
This will work when the field is there on the form, if it is hidden then how can we get? Is there any way to fetch the display value from the table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2015 06:25 AM
You get the display value from back-end scripts using 'current.fieldName.getDisplayValue()'. You could use a 'display' business rule to pass that information to the client if the field wasn't on the form. You can refer to the wiki for information on 'display' business rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2018 02:02 PM
In certain contexts, such as a scoped application, the "$" or "gel" functions are not available. The following code provided the solution I needed:
var fieldName = 'x_my_field_name';
var selector = '[id="' + g_form.getTableName() + '.' + fieldName + '_nonedit"]';
var displayValue = g_document.getElement(selector).innerText;
For more information about "g_document", please refer to the GlideDocumentV3 documentation.