How to get list of incident form design field in rest API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-16-2022 07:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-16-2022 08:16 AM
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-17-2022 08:16 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-17-2022 08:18 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-17-2022 10:11 PM
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