How to Create Database View for Request Item, Survey results in ServiceNow?

PrasannaKuD
Tera Contributor

Hi Team,

I'm trying to create database view for Request Item, SCTASK and Assessment Instance (asmt_assessment_instance), Assessment Metric (asmt_metric), Assessment Metric result (asmt_metric_result)

 

1. Username who gave the survey
2. RITM and SCTASK Number
3. Assignment group to which this ticket was assigned in SCTASK
4. User rating what he gave out of 5
5. User comments if he put any
6. date of survey triggered
7. date of survey filled

 

I have configured the setup as per the below screenshot and table. Kindly review the configuration and let me know if there are any corrections required.

 

The table is taking a significant amount of time to load the data. Additionally, the "Actual Value" and "String Value" fields are appearing empty for all the records.

Kindly review and advise on this issue.

 

Additionally, please suggest if there are any alternative approaches to achieve the same requirement.

 

If there are any similar configuration requirements or existing implementations, kindly share those details as well.

 

PrasannaKuD_0-1778161510362.png

TableOrderVariable PrefixWhere ClauseLeft Join Active
asmt_assessment_instance100asmtInst FALSETRUE
sc_req_item200ritmasmtInst_trigger_id = ritm_sys_idTRUETRUE
sys_user300usrasmtInst_user = ritm_requested_forTRUETRUE
asmt_metric_result400metricResmetricRes_instance=asmtInst_sys_idTRUETRUE
asmt_metric500metricmetricRes_metric=metric_sys_idTRUETRUE
sc_task600sctasksctask_request_item = ritm_sys_idTRUETRUE
sys_user_group700grpsctask_assignment_group = grp_sys_idTRUETRUE

 

 Thanks & Regards,

Prasanna Kumar

 

4 REPLIES 4

Vishal Jaswal
Tera Sage

Hello @PrasannaKuD 

Please avoid using uppercase in the variable prefix as per this KB article here: KB0727206 - A similar community post resolved few days ago see this .

I have submitted an idea to ServiceNow, please vote so that ServiceNow takes care of it and subscribe to get any updates on this idea here: https://support.servicenow.com/ideas?id=view_idea&sysparm_idea_id=b2af31cf935ccbd8e7eef35d6cba1097&s...


Hope that helps!

Hi Vishal,

After changing the prefix, still nothing has been changed. Still the "Actual Value" and "String Value" fields are appearing empty for all the records.

Thanks & Regards,

Prasanna Kumar

Hello @PrasannaKuD 

Working as expected:
VishalJaswal_0-1778862792224.png

 

VishalJaswal_1-1778862821070.png

 


Hope that helps!

Artur Makowski
Tera Contributor

Hi,

I see you miss condition to join the sys_user table.

I suggest either of 2 options:

- use "usr_sys_id=asmtInst_user" in the where clause for sys_user table

- drop the sys_user from the join (you need to move the condition for , if you need any user data, then you may anywhere dot-walk from either of asmtInst_user or ritm_requested_for attribute.

 

Also, not sure if existing condition asmtInst_user = ritm_requested_for does any good, IMHO it is redundant (if not even harming...)

This should fix the slowness (system tries to process all users...)

 

Regards,

Artur