Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

how to edit already submitted survey cores rating 3 to 4

Aparna
Tera Contributor
 
1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @Aparna,

 

As @Dr Atul G- LNG advises, proceed with caution. However, assuming this process has been considered and it is possible that a score legitimately needs to be updated, use the following script in either a Background script or Fix Script for re-use if required.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

try {
    var surveyGR = new GlideRecord("asmt_assessment_instance_question");
    if (surveyGR.get("012a2c44d7211100158ba6859e6103b9")) { // This is the sys_of of the question to update on the submitted survey //Check this by reviewing the questions and make sure you have the correct one.
        gs.print('Survey Instance, question and value: ' + surveyGR.instance.getDisplayValue() + ' - ' + surveyGR.metric.getDisplayValue() + ' :' + surveyGR.value);
        surveyGR.value = 3; //modifying value field
        surveyGR.setWorkflow(false); //Prevent trigger Business rules, workflows etc
        //Once you are happy you have the correct question - uncomment the below update() line
        //surveyGR.update(); 
    }
} catch (e) {
    gs.info('Error thrown in Background Script / Fix Script: Name to be entered here if Fix Script' + e);
}

 

View solution in original post

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Aparna 

 

Any reason to make change in score, it is against policy. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

actually user gave the survey score 3 by mistake but now he wants to give 4 in the place of 3

Hi @Aparna 

 

https://www.servicenow.com/community/now-platform-forum/is-it-possible-to-edit-a-submitted-survey/m-...

 

https://www.servicenow.com/community/service-management-forum/can-you-edit-a-survey-response/m-p/412...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

I have that survey_admin role but im not able to edit that score can you please help me on this