Is there an easy way to get the display value of a catalog item variable?

MWright1
Giga Guru

I have a reference field in our Service Portal Catalog item called Job Title.

When someone changes it, I need to capture the display value, not the reference, then run other Logic based on the title.

I have tried:

var title = g_form.getDisplayBox('job_title').value;

but it doesn't work.

I just find it so silly to have to create a whole new Script Include just to get the Display value.  Is this my only option?

Thanks.

1 ACCEPTED SOLUTION
4 REPLIES 4

Hitoshi Ozawa
Giga Sage
Giga Sage

Hi,

Just getDisplayValue('<field name>'); should work in Service Portal.

var title = g_form.getDisplayValue('job_title');
alert(title);

MWright1
Giga Guru

Thanks, everyone!

Ankur Bawiskar
Tera Patron
Tera Patron

@MWright 

Glad to know that you referred to my blog.

I hope you have marked it helpful and also bookmarked it.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader