Using database view to report on variables

Jimmy Ho
Tera Contributor

Currently, if I simply report on the sc_req_item table I am able to CHOOSE COLUMN select into Variables[+], select a catalog item and then choose from one of the field variables and add it to the column of the report. 

JimmyHo_0-1692864223302.png  JimmyHo_1-1692865133612.png  JimmyHo_2-1692865202521.png

JimmyHo_3-1692865275909.png

 

 

Currently, I need to report on both the sc_req_item table and sys_approval_approver table to see the current approver for the ritm in the report. I have created a database view table for both sc_req_item and sys_approval_approver, however 'Variables[+]' option is no longer available in the 'choose column' button when reporting.

 

Following the following KB, I was able to report on the variables and values (last image of link). 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0962438#:~:text=The%20variabl...

 

Is there a way I could add a variable to the column of a report on a Database View as well? Any suggestions would be appreciated.

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Jimmy Ho 

the variable itself is shown in Column Question in the last image. What extra info is required?

May I know what's your business requirement to show this detailed information and to which user?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Jimmy Ho
Tera Contributor

Yes, the scenario in the last image is exactly what I am trying to achieve. Because that is reporting directly off of the sc_req_item table, I am able to add the question fields directly into the column (i.e Destination).

 

However, when I try to report off of a Database View, I am unable do find Variables[+]. This is the case even if sc_req_item is the only table in the database view.

 

To reiterate, what I want to achieve is the be able to have field variables on the column (like in the last image of the original post) but for Database View.

ZiadZ
Tera Contributor

did you ever figure this out Jimmy? I'm currently doing something similar and getting similar results as you. I'm trying to combine parent task details (which returns the questions/answers) with the child task that are in a scoped application.

MireilleEdwards
Tera Contributor

Hello,

 

While searching on a similar topic, I came across this knowledge article.

 

Variable columns do not show on List Report when selected table is a Database View - Known Error

 

This is a known error where you can't show variables when reporting on a database view as your source.  Hope this is helpful.

 

Mireille