Survey : Capture feedback via email

srivatsa_tatti
Mega Sage

Hi ,

 

We have embedded a smiley in email for feedback which is being triggered as a notification, similar to this.

 

https://www.servicenow.com/community/itsm-forum/inbound-action-to-update-assessments/m-p/2528013#M49...

 

On clicking on any smiley email would be sent to the ServiceNow instance with rating and feedback (Option text) in the body.

 

 

 

	var gt = new GlideRecord('asmt_metric_result');
		gt.initialize();
		gt.instance = current.sys_id;
		gt.source_id = source;
// 		gt.normalized_value = nv;
// 		gt.actual_value = resp;
// 		gt.string_value = resText;
		gt.setValue('string_value',resText);
		gt.setValue('actual_value', resp);
		gt.setValue('normalized_value', nv);
		gt.datatype = dataType;
		gt.metric.datatype = dataType;
		gt.metric.method= 'assessment';
		gt.assessment_group = current.assessment_group;
		gt.user = current.user;
		gt.taken_on = gdt.getDisplayValue();
		gt.metric.category = current.metric_type;
		gt.metric = metric;
		//gt.setWorkflow(false);
		gs.info("SRI SURVEY Source = " + source + ", actual_value = " + resp + ", string_value = " + resText + ", normalized_value = " + nv + ", metric = " + metric + " ,dataType = " + dataType + " USer = " + current.user + " UserID. = " + gru.user_name + " TIME = " + gdt + " metDef === " + metDef);
		var id = gt.insert();

 

 

 

Inbound action is written to read the body and insert into metric_result table, but it always the results (actual values) are stored as "-1". In the logs the actual values are correctly logged.

 

Any help on this would be much appreciated.

 

 

srivatsa_tatti_0-1684475221828.png

 

Thanks

Sri

1 REPLY 1

Mallidi Suma
Tera Guru

Hi @srivatsa_tatti ,

 

I believe there is an issue in your inbound email action or in the notification mail script which you are using to send the survey notification.

 

Please find the below community article, the excel which is there in the article as an attachment will give you all the scripts and the detailed process.

https://www.servicenow.com/community/developer-articles/embedding-emoticon-s-smiley-survey-in-email-...

 

Please mark my answer as helpful and accept it as a solution, if it helps you!!