{"record":{"id":"06f585136ce7d146","repo":"appsmithorg/appsmith","slug":"pe-arg-5000-06f585","errorCode":"PE-ARG-5000","errorMessage":"Missing required field 'Spreadsheet Url'","messagePattern":"Missing required field 'Spreadsheet Url'","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/FileDeleteMethod.java","lineNumber":33,"sourceCode":"import java.util.Map;\nimport java.util.Set;\n\n/**\n * API reference: https://developers.google.com/sheets/api/guides/migration#delete_a_sheet\n */\npublic class FileDeleteMethod implements ExecutionMethod {\n\n    ObjectMapper objectMapper;\n\n    public FileDeleteMethod(ObjectMapper objectMapper) {\n        this.objectMapper = objectMapper;\n    }\n\n    @Override\n    public boolean validateExecutionMethodRequest(MethodConfig methodConfig) {\n        if (methodConfig.getSpreadsheetId() == null\n                || methodConfig.getSpreadsheetId().isBlank()) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, ErrorMessages.MISSING_SPREADSHEET_URL_ERROR_MSG);\n        }\n        return true;\n    }\n\n    @Override\n    public Mono<Object> executePrerequisites(MethodConfig methodConfig, OAuth2 oauth2) {\n        return Mono.just(true);\n    }\n\n    @Override\n    public WebClient.RequestHeadersSpec<?> getExecutionClient(WebClient webClient, MethodConfig methodConfig) {\n\n        UriComponentsBuilder uriBuilder =\n                getBaseUriBuilder(this.BASE_DRIVE_API_URL, methodConfig.getSpreadsheetId(), /* spreadsheet Id */ true);\n\n        return webClient.method(HttpMethod.DELETE).uri(uriBuilder.build(true).toUri());\n    }","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/FileDeleteMethod.java#L15-L51","documentation":"Thrown by FileDeleteMethod.validateExecutionMethodRequest (FileDeleteMethod.java:33) when `methodConfig.getSpreadsheetId()` is null or blank. The DELETE call to the Drive API needs a target file id, which is extracted from the spreadsheet URL earlier; if extraction failed or the URL was never supplied, the id is empty. Code PE-ARG-5000 (PLUGIN_EXECUTE_ARGUMENT_ERROR).","triggerScenarios":"Running the 'Delete Spreadsheet' action with the Spreadsheet URL field empty, whitespace-only, or a URL that did not match the extraction regex so the derived id is null. Validation runs before any network call, so this fires pre-flight.","commonSituations":"The URL field's binding `{{widget.text}}` resolves to empty because the widget has no value; the user cleared the field to test; a select widget's default option is empty and the delete ran before a selection; URL was pasted without the `https://` scheme so id extraction yielded nothing.","solutions":["Provide a complete Google Sheets URL in the 'Spreadsheet URL' field, e.g. `https://docs.google.com/spreadsheets/d/<id>/edit`.","Ensure the bound widget actually has a value before the delete action is enabled (disable the button until non-empty).","Confirm the URL matches the pattern `https://docs.google.com/spreadsheets/d/<id>/` so id extraction succeeds in MethodConfig."],"exampleFix":"// before\n{\n  \"sheetUrl\": \"\"     // empty binding\n}\n// after\n{\n  \"sheetUrl\": {{selectSpreadsheet.selectedOptionValue}}  // guaranteed non-empty\n}","handlingStrategy":"validation","validationCode":"// Disable the delete action until a valid URL is present.\nfunction hasSpreadsheetUrl(url) {\n  return typeof url === \"string\" && /https:\\/\\/docs\\.google\\.com\\/spreadsheets\\/d\\//.test(url);\n}\n// Button 'disabled' prop: {{ !hasSpreadsheetUrl(urlInput.text) }}","typeGuard":"function isNonBlankString(v) { return typeof v === \"string\" && v.trim().length > 0; }","tryCatchPattern":"if (deleteSpreadsheet.error && deleteSpreadsheet.error.message.includes(\"Missing required field 'Spreadsheet Url'\")) {\n  showToast(\"Select a spreadsheet to delete first.\", \"error\");\n}","preventionTips":["Bind the Spreadsheet URL field to a widget with a guaranteed non-empty default.","Disable destructive actions (delete) until all required fields are populated.","Validate the URL matches the canonical pattern before submit."],"tags":["google-sheets","appsmith","input-validation","delete-spreadsheet","required-field"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}