How to get displayValue of reference on Service Portal

Mark Roethof
Tera Patron
Tera Patron

Hi all,

I'm trying to get the display value of an entered Reference variable on a Catalog Item. So on the Service Portal (= Mobile). Though, how?!

When using for example script editor in Client Script, g_form. doesn't show any usable options. I tried manually to use g_form.getDisplayValue('field_name'), not working. g_form.getDisplayBox('field_name') also does not work (also not with added .value) (i'm doing this on the Service Portal).

Any ideas?

So for example, my reference field is 'location', and I would like to get my hands on the display value of the location (onChange or onSubmit).

I could think of a workaround to do this thru a Workflow or insert Business Rule on the variables, though would like to know if it's possible to get the display value of the just entered Reference variable.

Kind regards,
Mark

---

LinkedIn

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

1 ACCEPTED SOLUTION

Omkar Mone
Mega Sage

Hi Mark,

 

Silly one but just for information, can we see if there is any display value for that table, because i was able to get the display value with g_form.getDisplayValue.Check the below ss for the same :- 

 

find_real_file.png

 

SS of the alert : -

find_real_file.png

 

Regards,

Omkar Mone.

View solution in original post

7 REPLIES 7

I am not able to call "g_form. getDisplayBox" method of g_form in my PDI, need help

 

 

Screenshot 2024-08-06 143946.png

Harsh Vardhan
Giga Patron

just to confirm , make sure client script UI Type has set as ALL. 

Varsha Jadhav1
Giga Expert

Hi mark,

eg: i want to take user location on serviceportal then you need to take v.loc=gr.getDisplayValue('location');

find below attachment