Database view query from sys ID

Wei_ Ling
Tera Guru

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)

 

Wei_Ling_0-1720418340484.png

 

7 REPLIES 7

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!



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

Trupti94
Tera Guru

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