Get display field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2024 09:50 AM
Using the table API, I am trying to filter on a reference display_value. I thought it would work like:
~/api/now/table/customer_account?sysparm_query=primary_contact.display_value={DisplayValue}
To make this filter work, I realized I needed to use the column the display_value is derived from which for the customer_contact table that would be name. Working query below:
~/api/now/table/customer_account?sysparm_query=primary_contact.name={DisplayValue}
My issue is that I want to find the column that the display value comes from programmatically to do this for multiple tables. Is there a table that holds information regarding what column/field is used for the display value?
The only thing I have found to return this type of information is:
~api/now/ui/meta/{table}
Using this endpoint for customer_contact and looking at the primary_contact column, I found the display_field is name. Result below:
This endpoint returns display_field for references, which could solve my issue, but I would prefer to get this information from a table.