How do you get the column name for the display value of a reference field on its source table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 12:54 PM
How do you get the field name value from the table that a reference field in a record is referring to? For example in an incident record, the "assigned to" field displays the name "Joe Shmoe", this is a reference field to the "sys_user" table, where the value "Joe Shmoe" is stored on a specific record in a specific column. I need to be able to get the column name in which that name that was being displayed in the reference field is being stored. This is being done via a script step at the moment. I am thinking there is going to be some built in function such as ".getReference()" that provides this type of information. ".getReference()" is providing me the name of the source table for the reference value at the moment but I need to get the column name for that display value still.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 01:42 PM
Hi Jason,
You can use these
getDisplayValue('field name') //Server side
g_form.getDisplayBox('field_name'); //Client Side
Mark Correct or Helpful if it helps.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 06:08 AM
Yousaf,
This would only provide the display value of the field on the incident table. I need the column name of the display value on the table it is referencing. Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 04:45 AM
Hi Jason,
I misunderstood maybe you can leverage getReferenceTable() somehow for that.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2022 07:38 AM
You can try these:
gr.referenceField.getRefRecord().getDisplayName(); //Server side field name of referenced record
g_form.getDisplayBox('referenceField').attributes[1].name; //Client side field name of referenced record