Get Column Label Names for Incident Table with Rest API

Tim McFadden
Kilo Contributor

How do I query the rest API for Column Label Names?  I can query one incident to get all the columns like this.

https://myDev.service-now.com/api/now/v1/table/incident?sysparm_limit=1

find_real_file.png

 

But I need to get all the labels for each of the columns

find_real_file.png

1 ACCEPTED SOLUTION

John VanBruggen
Giga Guru

You can use this and it will get all the fields from incident and task.

Incident extends task so it also inherits all the fields from task.

https://{INSTANCENAME}.service-now.com/api/now/table/sys_dictionary?sysparm_query=name%3Dincident%5EORname%3Dtask&sysparm_fields=column_label

Check out my Consultant's Survival Guide
https://youtube.com/watch?v=zYi8KhP9SUk

View solution in original post

19 REPLIES 19

You were close, but not quite all the way there.  Your call was only returning the fields on the incident table, but did not return the fields for the task table that Incident extends from.  As he indictated, he wanted all the fields that are a part of incident.  This includes both tables.  If you look at the API call I supplied, it returns the fields from both tables, not just the Incident table.

Keep up your good work here on the community 🙂

Check out my Consultant's Survival Guide
https://youtube.com/watch?v=zYi8KhP9SUk

Hello John, I think you haven't seen all of my comments for this thread. I have given the endpoint url to get both incident and task fields. The API which you have provided is correct and the same was provided by me prior to your reply I appreciate your efforts showing the demo too for the same

Harika Bhupathi
Giga Guru

You were right too 🙂

Thank you

Harika Bhupathi
Giga Guru

I feel offensive @John VanBruggen 

Please don't.  You don't know my personality.  I liked your last response (which I don't see here anymore).  I genuinely feel like you are a great contributer to the community.  As you stated earlier.  I was right too, we were both right.  You were just faster.  We are all doing our best to built a fun and friendly community.  I will delete the Kudo's troophy if you don't like it.  I wasn't trying to be offensive.  

Check out my Consultant's Survival Guide
https://youtube.com/watch?v=zYi8KhP9SUk