Creating a custom report for Positive and Negative Customer Survey Response and not working as expected.

Rhonda9
Tera Expert

Hello,

I built a customer report for Positive and Negative Customer Responses. 

I created a customer field named "customer response type".

I also created 2 business rules . 1st rule.  defines a positive response and 2nd rule that defines a negative response.  

The problem I am having is if a customer submit a survey and they have chosen both negative and positive response on one survey.  I want the survey metric response to count only once and as a negative response.   If the customer choose all positive responses, it only counts a 1 positive survey result.  If the customer choose all negative response, it only counts as 1 negative response.  The only part that is not working as expected is when customer choose a combo of negative and positive response.  Sometimes it counts as a positive response and sometimes negative .  Sometimes it will not count at all.   

Please review screenshots of my business rules and report.    

Any assistance would be appreciated.

Negative Customer Response BR

find_real_file.png

 

find_real_file.png

Positive Customer Response BR

find_real_file.png

find_real_file.png

Customer Satisfaction Survey Report

find_real_file.png

 

3 REPLIES 3

Marcin20
Mega Guru

Hi,

 

I propose to change the condition in the first business rule - remove the second part so that it will be:

String value - is one of - Dissatisfied, Very dissatisfied

 

The other approach could be that the user is allowed to select only one value for the String value field. That seems to be simpler for creation and maintenance of the report.

 

Best Regards,

Marcin

 

If my answer helped you in any way, please mark this answer as helpful and correct.

 

Thank you ,  

 

That makes perfect sense and I tried it but now when i complete a survey as a customer and select a positive and negative from the 5 question but it is  getting counted as a positive  and negative response.   I just want it to be one negative response. 

 

Taranjeet Singh
Giga Expert

Try this:

Set 'Positive Response' as default value for the 'customer response' and create only one after business rule as below:

find_real_file.png

 In the Advanced script add:

(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('asmt_metric_result');
 gr.addQuery('instance', current.instance);
 gr.query();
while(gr.next()){
gr.u_customer_response = 'negative'; // assuming your field name is 'u_customer_response' and value is negative for negative response
gr.update();
}
})(current, previous);