We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

database view on pm_project and sys_audit

samadam
Kilo Sage

I am trying to create a database view with pm_project and sys_audit and cannot get it to working. Tried to put this in the where clasue on sys_audit table in the view but not working. 

 

sysa_documentkey=proj_sys_id

Any idea how to get this working?

 

 

 

 

2 REPLIES 2

YashwanthV18760
Giga Guru

Hi @samadam 

 

To create a database view joining pm_project and sys_audit using sysa_documentkey=proj_sys_id in the WHERE clause, follow these steps:

  1. Create a new database view and add both tables (pm_project and sys_audit) to the view. 
  2. For each table, specify a unique variable prefix in lowercase (e.g., proj for pm_project, sysa for sys_audit). This prefix is required for the WHERE clause .
  3. In the View Table form for sys_audit, set the WHERE clause as: sysa_documentkey=proj_sys_id. Use the variable prefixes, so it should be: sysa_documentkey=proj_sys_id .
  4. Ensure the join fields (sysa_documentkey and proj_sys_id) are included in the View Fields related list; otherwise, the join will fail .
  5. Save and test the view to verify the join works as expected .

samadam
Kilo Sage

I did the same way but it is returning empty