Inactivating a survey

David Neustadt1
Tera Contributor

Hello,

I have a survey defintion that is being replaced with a newly designed one. 

In terms of our old surveyu if I inactivate (Active = FALSE) our old survey definition record will this also render the related survey category, survey questions and assessment metric definitions from being seen or used also? Does inactivation of a survey definition cascade to the related survey category, survey questions and assessment metric definitions from being used also? I understand that inactivating a survey will render any open assessments with users assigned that survey from being completed however the previous survey results recorded will be preserved. Thanks

 

1 REPLY 1

Amit Gujarathi
Giga Sage
Giga Sage

HI @David Neustadt1 ,
I trust you are doing great.
Here's a code snippet to programmatically inactivate a survey definition and its related entities if needed:

// Replace 'your_survey_sys_id' with the sys_id of the survey you want to inactivate
var surveySysId = 'your_survey_sys_id'; 

// Inactivate Survey Definition
var surveyGr = new GlideRecord('asmt_assessment_definition');
if (surveyGr.get(surveySysId)) {
    surveyGr.active = false;
    surveyGr.update();
}

// Optional: Inactivate related categories, questions, and metrics
// Note: This requires identifying the relationships and writing additional code

// Add your code here to inactivate related categories, questions, and metrics

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi