Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

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

Not applicable
4 REPLIES 4

Not applicable

Hitoshi Ozawa
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

@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  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader