appsmithorg/appsmith · error · AppsmithPluginException

PE-ARG-5000

PE-ARG-5000

Error message

Missing required field 'Spreadsheet Url'

What it means

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).

Source

Thrown at app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/FileDeleteMethod.java:33

import java.util.Map;
import java.util.Set;

/**
 * API reference: https://developers.google.com/sheets/api/guides/migration#delete_a_sheet
 */
public class FileDeleteMethod implements ExecutionMethod {

    ObjectMapper objectMapper;

    public FileDeleteMethod(ObjectMapper objectMapper) {
        this.objectMapper = objectMapper;
    }

    @Override
    public boolean validateExecutionMethodRequest(MethodConfig methodConfig) {
        if (methodConfig.getSpreadsheetId() == null
                || methodConfig.getSpreadsheetId().isBlank()) {
            throw new AppsmithPluginException(
                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, ErrorMessages.MISSING_SPREADSHEET_URL_ERROR_MSG);
        }
        return true;
    }

    @Override
    public Mono<Object> executePrerequisites(MethodConfig methodConfig, OAuth2 oauth2) {
        return Mono.just(true);
    }

    @Override
    public WebClient.RequestHeadersSpec<?> getExecutionClient(WebClient webClient, MethodConfig methodConfig) {

        UriComponentsBuilder uriBuilder =
                getBaseUriBuilder(this.BASE_DRIVE_API_URL, methodConfig.getSpreadsheetId(), /* spreadsheet Id */ true);

        return webClient.method(HttpMethod.DELETE).uri(uriBuilder.build(true).toUri());
    }

View on GitHub (pinned to 8cd9021c24)

Solutions

  1. Provide a complete Google Sheets URL in the 'Spreadsheet URL' field, e.g. `https://docs.google.com/spreadsheets/d/<id>/edit`.
  2. Ensure the bound widget actually has a value before the delete action is enabled (disable the button until non-empty).
  3. Confirm the URL matches the pattern `https://docs.google.com/spreadsheets/d/<id>/` so id extraction succeeds in MethodConfig.

Example fix

// before
{
  "sheetUrl": ""     // empty binding
}
// after
{
  "sheetUrl": {{selectSpreadsheet.selectedOptionValue}}  // guaranteed non-empty
}
Defensive patterns

Strategy: validation

Validate before calling

// Disable the delete action until a valid URL is present.
function hasSpreadsheetUrl(url) {
  return typeof url === "string" && /https:\/\/docs\.google\.com\/spreadsheets\/d\//.test(url);
}
// Button 'disabled' prop: {{ !hasSpreadsheetUrl(urlInput.text) }}

Type guard

function isNonBlankString(v) { return typeof v === "string" && v.trim().length > 0; }

Try / catch

if (deleteSpreadsheet.error && deleteSpreadsheet.error.message.includes("Missing required field 'Spreadsheet Url'")) {
  showToast("Select a spreadsheet to delete first.", "error");
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of appsmithorg/appsmith@8cd9021c24 (2026-08-12). Data as JSON: /api/errors/06f585136ce7d146. Report an issue: GitHub.