There is no delete response event trigger available for both Google Sheets events and Google Forms events.
One workaround that you may do is to create an onOpen()
installable trigger in your linked Google Sheets using Apps Script that will check if the Google Forms responses count using Form.getResponses() matches the available responses in your sheet whenever you open the linked Google Sheets.
Sample Apps Script:
function onOpen(e) {
var form = FormApp.openById('Forms file id here');
var formResponses = form.getResponses();
var responseSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Form Responses 1');
//Get number of responses saved in the sheet (Subtract 1 for the header row);
var sheetResponses = responseSheet.getLastRow() - 1;
Logger.log(formResponses.length);
Logger.log(sheetResponses);
if (formResponses.length != sheetResponses){
var ui = SpreadsheetApp.getUi();
var result = ui.alert(
'Warning',
'Responses did not match.',
ui.ButtonSet.OK);
// Sync responses here
}
}
Sample Forms Responses:
Sample Output: (when you open your linked Google Sheets)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…