How to get field Alias Name through Rest API

Mohd1
Mega Contributor

I want to query the alias name of all the fields of Incident table. Is there a way to query that through table API?

Table - Incident

Field - Short_description

Alias - Short Description

Appreciate the help.

1 ACCEPTED SOLUTION

Hello,

1. To appear in the table choice list, the table needs to be reportable. Most 'sys_' tables are not reportable by default. You can add it to this system property so that it can be: glide.ui.permitted_tables
Ref: https://docs.servicenow.com/bundle/newyork-performance-analytics-and-reporting/page/use/reporting/co...

2. That is not being returned most likely because that field was inherited from the task table and that is the table reference in it's dictionary record. That appears to be the case on sys_documentation as well.

find_real_file.png

View solution in original post

3 REPLIES 3

Robert Beeman
Kilo Sage

You could use the Table API to query the sys_dictionary table for the Column Label. In the REST API Explorer I was able to submit this sysparm_query "name=incident^element=caller_id", and set this sysparm_fields "column_label" and it returned 'caller_id's label.

find_real_file.png

find_real_file.png

 

Ref: https://docs.servicenow.com/bundle/newyork-application-development/page/integrate/inbound-rest/conce...

Thank you for you response Robert! Couple of followup questions.

 

1. What is the usage of sys_documentatio then? See the link below which explain that labels are stored in this table but for some reason this table won't show in the dropdown to query on Rest API explorer page.

https://docs.servicenow.com/bundle/madrid-platform-administration/page/administer/managing-data/conc...

2. Additionally i see some of the field not being returned by sys_dictionary table. If i query following where clause, I get no result even though the incident table has this field.

name=incident^element=short_description

Hello,

1. To appear in the table choice list, the table needs to be reportable. Most 'sys_' tables are not reportable by default. You can add it to this system property so that it can be: glide.ui.permitted_tables
Ref: https://docs.servicenow.com/bundle/newyork-performance-analytics-and-reporting/page/use/reporting/co...

2. That is not being returned most likely because that field was inherited from the task table and that is the table reference in it's dictionary record. That appears to be the case on sys_documentation as well.

find_real_file.png