Get Variable Value Using Variable Attributes

Wasdom_Kung
Tera Guru

Hello,

I am using a reference field that displays multiple columns of information from the sc_requested_item table, namely the RITM, Created and Requested for columns.

I would also like to pull two values: u_employee_forename and u_employee_surname and also display this in the reference field, is this possible?

I've tried the following as an example:

ref_auto_completer=AJAXTableCompleter,ref_ac_display_value=false,ref_ac_columns=opened_at;requested_for; variables.u_employee_forename,ref_ac_columns_search=true; 

find_real_file.png

I've not seen if anyone else has tried to accomplish this before.

 

11 REPLIES 11

Rafal Rataj1
Giga Expert

what is variables.u_employee_forename ? 
if you are in request management process you should use the fields form RITM 

requested_for or opened_by

 

 

So that's where my challenge is, variables.u_employee_forename is a variable from ANOTHER requested item, not the current record.

I'm looking for a way to populate the forename and surname from the selected / target record to the reference on this form.

I have used onChange and Script includes to pull these values to a readonly field, but it'd be easier for the customer to see what RITM record is for them by displaying their name in the reference options.

I don't think so it is possible to display variables in reference column. It can only show the fields present on RITM table. For e.g: RITM number, Requested by, Requested for etc.

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

if it is another RITM then it should be only a parent then it should be accessible through the reference

 

based on doku

https://docs.servicenow.com/bundle/quebec-platform-administration/page/administer/field-administration/concept/c_AutoCompleteForReferenceFields.html

you have just separate 3 autocompleters 

  • AJAXReferenceCompleter: Displays matching auto-complete choices as a drop-down choice list. The list only displays the reference table's display value column. Reference fields automatically use this class if there is no other auto-completion class specified.

 

  • AJAXTableCompleter: Displays matching auto-complete choices as rows in a table. The table displays the reference table's display value column and any columns listed in the ref_ac_columns attribute.

 

  • AJAXReferenceChoice: Displays matching auto-complete choices as a drop-down choice-list. The list only displays the reference table's display value column. Furthermore, the list only displays up to 25 matching choices. If there are more than 25 auto-complete choices, the reference field instead displays the choices with the AJAXTableCompleter class.