How to exclude a survey question from the total average score

bill_dev
Mega Guru

This applies to one of our surveys which has 4 questions. 3/4 are valid scale questions while the 4th one is "Additional Comments". We don't want additional comments to be include on the final score calculation.

1 ACCEPTED SOLUTION

pavani_paluri
Tera Guru
Tera Guru

Hi @bill_dev ,

ServiceNow stores survey responses in the asmt_assessment_instance_question table.
Each question has a question type (e.g., scale, text, choice).
"Additional Comments" is likely a text-type question, which doesn't have a numeric score.
Filter Only Scored Questions
When calculating the average score, use a GlideRecord or script to:
Exclude questions where question.type is not a scale (e.g., Likert, numeric).
Include only questions with numeric responses.
Use Business Rules or Script Includes
You can automate this logic using a Script Include or Business Rule to calculate and store the average score. Trigger it on survey submission or when needed.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

 

View solution in original post

2 REPLIES 2

pavani_paluri
Tera Guru
Tera Guru

Hi @bill_dev ,

ServiceNow stores survey responses in the asmt_assessment_instance_question table.
Each question has a question type (e.g., scale, text, choice).
"Additional Comments" is likely a text-type question, which doesn't have a numeric score.
Filter Only Scored Questions
When calculating the average score, use a GlideRecord or script to:
Exclude questions where question.type is not a scale (e.g., Likert, numeric).
Include only questions with numeric responses.
Use Business Rules or Script Includes
You can automate this logic using a Script Include or Business Rule to calculate and store the average score. Trigger it on survey submission or when needed.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

 

bill_dev
Mega Guru

I found out that the average score is a custom field and the calculation is a custom business rule. I'll go ahead and use "Weight" on the code. If weight is 0, exclude it from the calculation.