Remove sys_domain field and/or logic from Table API results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 12:30 PM
Hi,
We are not using domain seperation, so the sys_domain field is not relevant to us at all. However, it keeps showing up in our table api results for CSM tables. Normally i wouldnt mind and just ignore it, but i noticed whenever the sys_domain field is included in results my query takes around 15-20 seconds longer, so i would really like to get this out of the default set of fields (which seem to be sys_id, sys_domain, sys_class_name) the table API returns. Anyone any direction where to do this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 06:47 PM - edited 12-27-2024 06:49 PM
Hello Rik,
To replicate this behavior, I used the REST API Explorer in my PDI on the Incident table. The response does include the sys_domain
field, even if its value is set to "global."
To exclude this field, you can specify the exact fields you need in the API response instead of retrieving all the fields from the Table API. This can be achieved using the sysparm_fields
parameter.
Here's an example:
https://XXX.service-now.com/api/now/table/incident?sysparm_fields=number,short_description
Using this approach will not only exclude unnecessary fields like sys_domain
but also enhance performance.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2025 01:07 PM
Thanks for the answer. I am aware of the parameter to only include specific fields, which is how i found out excluding the field makes the query 15-20 seconds faster. But the issue lies in that the table api will be used and queried by our customers, and for security reasons i want to keep strict control of the set of fields being returned, so it never returns data its not allowed to expose when doing a normal query (without specified fields). But the sys_domain fields keeps showing up even though i dont have it specified anywhere to be returned and seems to be part of the default set of returned values (sys_id, sys_domain, sys_class_name). It is no problem this info is exposed as its not containing any restricted data, but its slowing down the query massively for some reason, which is why i want to cut it out.