Admin unable to view a database view

nowdev777
Tera Contributor

I have created a simple DB view configured as follows:

  • Table: Metric Data [sn_grc_metric_metric_data]
  • Where clause: None
  • Left join: False
  • View fields:
    • value

When I click "try it", it returns as follows. However when I go directly to the sn_grc_metric_metric_data.LIST, I can see all of the records. Does anyone know what is causing this and how to configure the access. Thank you.

 

Database View (not working)

nowdev777_0-1743166272149.png

 

.LIST going directly to the table

nowdev777_1-1743166470767.png

 

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @nowdev777 

A DB view is used when you need to join two or more tables. In the first table you showed, what is the second table? Also, without a WHERE clause, it won't work. You can check the OOTB database view for clarity, mate.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

nowdev777
Tera Contributor

@Dr Atul G- LNG thanks for your reply. I was originally trying to link it with multiple other tables, but was getting the results described above, so I removed the other tables as part of the troubleshooting steps to determine the cause. I believe database views can be of a single table, right? I don't think this is whats causing the issue.  To me I believe this is some sort of a permission issue but I have no idea how to resolve it. I have added a where clause as you suggested and am still getting the same results. Do you have any other ideas? 

 

 

Hi @nowdev777 

 

I believe database views can be of a single table, right?

Atul: No, DB only work more than 1 table.

 

I don't think this is whats causing the issue.  To me I believe this is some sort of a permission issue but I have no idea how to resolve it. I have added a where clause as you suggested and am still getting the same results.

Atul: Which other table you add where clause?

 

https://www.servicenow.com/docs/bundle/yokohama-platform-administration/page/use/reporting/concept/c...

 

AGLearnNGrow_0-1743171358341.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

@Dr Atul G- LNG 

 

I believe database views can be of a single table, right?

Atul: No, DB only work more than 1 table.

- I just created another DB view on the sn_grc_issue record to test this, no where clause and no join and it returns all of the issue records correctly. I believe it's fine doing a DB view with a single table (not that this is the use case for DB view but for troubleshooting purposes it should still return fine)

 

I don't think this is whats causing the issue.  To me I believe this is some sort of a permission issue but I have no idea how to resolve it. I have added a where clause as you suggested and am still getting the same results.

Atul: Which other table you add where clause? 

- I didn't add another table because thats not the issue, the issue is permissions or something specific to this table, as mentioned above I created another DB view with sn_grc_issue (single table, no where clause, no join with another table) and it returns fine and I can see all of the records. There is either a permission or something special with the sn_grc_metric_metric_data table. 

 

Do you happen to have any other ideas what could be going on?