Advance Reference Qualifier to return Description of a Knowledge Base

chatsaurav19
Tera Contributor

Hi All,

 

What should be the correct script to return the description of a knowledge base using ARQ?

 

Example : If I am selecting a KB as shown then the current description should automatically pull up the description

 

chatsaurav19_0-1699352635737.png

I have tried achieving it like this for current description field but it isn't working:::

 

javascript: 'description=' + current.variables.knowledge_base_kbdmr.description 

 

( knowledge_base_kbdmr is the variable name for "Knowledge Base" variable )

 

Can someone please help?

 

Regards

Saurabh

 

 

8 REPLIES 8

Anil Lande
Kilo Patron

Hi,

What is the type of your variable 'Description'? I believe it should be Single Line text (or Multiline text).

If you want to auto populate it based on the selection of Knowledge base then you can use auto populate functionality.

https://www.servicenow.com/community/developer-articles/auto-populate-reference-data-in-service-cata...

 

If you are not using Utah or Vancouver version then you need to use GlideAjax/g_form.getReference method in onChange client script.

 

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hi @Anil

 

It is a reference field.

 

Regards,

Saurabh

chatsaurav19_0-1699355843538.png

 

Description variable should be of type Single line text, why it is created as reference?

Reference field will always show the display value of reference record selected in same field, not from other field.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande