Database view query from sys ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2024 10:59 PM
hello everyone,
I would like to know that I use database view in the form page, but the sys_id of database view record is not the sys_id commonly used by the system.
If I need to query data through the sys_id of database view record, What should I do, and is there an API to solve this problem?(Querying this sys_id directly with GlideRecord is invalid)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 12:01 AM
Hi @Wei_ Ling
If your database view in ServiceNow lacks a sys_id field, use GlideRecord to query data based on a unique identifier field (view_id) specific to your view.
-----------------------------------------------------------------------------------
Please consider marking my reply as Helpful 👍 and/or Accept Solution ✔️, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 12:50 AM
Will there be a sys_id field in the database view? Or is it just my configuration Settings that I don't have this field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 01:09 AM
Hi @Wei_ Ling ,
The database view in ServiceNow is a visual representation of data in which we combine multiple table but it doesn't get stored in any of the table and system doesn't generate sysids for those records.
Thanks