Fetch value from a Glide List field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 04:00 AM
Hi All,
I wanted to fetch the field value from a source table (type- Glide list) in an on load client script.based on that I have to perform certain operations in the target catalog item form.
Source Field:
----------------
Probable Target Fields:
-------------------------------
Thanks,
Sambit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 04:18 AM
I'm not sure I understand what you're trying to do, but you can always get a value of a field on a form (or even a hidden field that still exists on the form) using the GlideForm API's g_form.getValue() method:
g_form.getValue('yourFieldNameHere');
GlideList is a comma separated string of sys id's so you'll just get the sys id of the reference values:
"b6826bf03710200044e0bfc8bcbe5df8,a8f98bb0eb32010045e1a5115206fe3a"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 02:17 PM
This is very helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 04:30 AM
Hi Sam
Try following,
var fieldName = '<glide_list_field_name>';
var options = $(g_form.getTableName() + '.' + fieldName + '_nonedit').innerHTML;
alert(options);
If my answer helped you in any way, please then mark it correct and helpful.
Kind regards,
Manas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2019 04:42 AM
I'm not sure what would be the benefit of using this instead of the GlideForm API ServiceNow provides out of the box?