Code snippet function onFormSubmit(event) { // Get the selected options var options = event.submission.getAnswers("options"); // Check if the options are available for (var i = 0; i < options.length; i++) { // If the option is not available, remove it from the list if (!options[i]) { options.splice(i, 1); } } // Update the form with the new options event.submission.setAnswers("options", options); }