How to get list of incident form design field in rest API?

Deepak Paradhi2
Kilo Explorer

how can i get form design selected field list in incident page using rest api like 

instance-name.service-now.com/api/now

find_real_file.png

4 REPLIES 4

Niklas Peterson
Mega Sage
Mega Sage

Hi,

there are problably many ways of achieving this. One problem I see is that the data is scattered in multiple tables. Many years ago I wrote an article about documenting views using a Database view. 

https://community.servicenow.com/community?id=community_article&sys_id=6a6d2e29dbd0dbc01dcaf3231f961...

Using that approach you can expose that database view with the Table API and query for the Incident table view and return the fields on the form.

Regards,
Niklas

Good article but we want to rest API for incident table which for get only selected form layout/design fields.

I found one API but it show all fields. I want only form layout fields.

https://{instanceName}.service-now.com/api/now/ui/meta/incident

 

 

Deepak Paradhi2
Kilo Explorer

Good article but we want to rest API for incident table which for get only selected form layout/design fields.

I found one API but it show all fields. I want only form layout fields.

https://{instanceName}.service-now.com/api/now/ui/meta/incident

Hello again,

the purpose of the Database view described in the article is to do just that, give you only the fields that are on the form/view.

So if you build a DB view according to the article you would get a complete table of all the fields on all the views. If you want to you can of course limit the db view to only Incident table but that very specific and would limit you from query any other table view in the future.

Then query that DB view using the Table API and in the query filter only the relevant Incident view that you want to look at. That query would return all the fields on the form for that view.

But it will only get you so far. If you are looking for getting the same data as from /api/now/ui/meta/incident then maybe you need to write a scripted REST API to gather all the information from all the tables involved.

Regards,
Niklas