Fetch value from a Glide List field

sam352120
Kilo Guru

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:

----------------

find_real_file.png

 

Probable Target Fields:

-------------------------------

find_real_file.png

Thanks,

Sambit

 

 

9 REPLIES 9

emaasalmi
Kilo Sage

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"

This is very helpful.

Manas Kandekar
Kilo Guru

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

I'm not sure what would be the benefit of using this instead of the GlideForm API ServiceNow provides out of the box?