{"record":{"id":"2aa6c0d0f34df9e3","repo":"appsmithorg/appsmith","slug":"plugin-execute-argument-error","errorCode":"PLUGIN_EXECUTE_ARGUMENT_ERROR","errorMessage":"Expected a row object, but did not find it.","messagePattern":"Expected a row object, but did not find it\\.","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":null,"severity":"error","filePath":"app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/RowsUpdateMethod.java","lineNumber":251,"sourceCode":"                        \"majorDimension\", \"ROWS\",\n                        \"values\", List.of(objects))));\n    }\n\n    @Override\n    public JsonNode transformExecutionResponse(\n            JsonNode response, MethodConfig methodConfig, Set<String> userAuthorizedSheetIds) {\n        if (response == null) {\n            throw new AppsmithPluginException(\n                    GSheetsPluginError.QUERY_EXECUTION_FAILED, ErrorMessages.MISSING_VALID_RESPONSE_ERROR_MSG);\n        }\n\n        return this.objectMapper.valueToTree(Map.of(\"message\", \"Updated sheet successfully!\"));\n    }\n\n    private RowObject getRowObjectFromBody(JsonNode body) {\n\n        if (body.isArray()) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, ErrorMessages.EXPECTED_ROW_OBJECT_MESSAGE);\n        }\n\n        if (body.isEmpty()) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR, ErrorMessages.EMPTY_UPDATE_ROW_OBJECT_MESSAGE);\n        }\n\n        return new RowObject(this.objectMapper.convertValue(\n                        body,\n                        TypeFactory.defaultInstance()\n                                .constructMapType(LinkedHashMap.class, String.class, String.class)))\n                .initialize();\n    }\n\n    @Override\n    public void replaceMethodConfigTemplate(Map<String, Object> formData, Map<String, String> mappedColumns) {\n        String rowObjects = PluginUtils.getTrimmedStringDataValueSafelyFromFormData(formData, FieldName.ROW_OBJECTS);","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/googleSheetsPlugin/src/main/java/com/external/config/RowsUpdateMethod.java#L233-L269","documentation":"Thrown by private getRowObjectFromBody in RowsUpdateMethod (line 251) when body.isArray() is true. This method expects a single JSON object (row), not an array of rows. It is invoked from validateExecutionMethodRequest via objectMapper.readTree(body), so an array-shaped JSON in the 'Rows' field for an Update One Row action triggers it. Note: the code uses AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR directly (PLUGIN_EXECUTE_ARGUMENT_ERROR as the code string, not PE-ARG-5000). Message: EXPECTED_ROW_OBJECT_MESSAGE = \"Expected a row object, but did not find it.\".","triggerScenarios":"User put [{...}] (array) in the 'Rows' field of an Update Single Row action instead of {...}; a binding like {{ JSON.stringify(Table1.selectedRows) }} returns an array but the action expects one row.","commonSituations":"Confusion between 'Update Row' (single object) and 'Bulk Update Rows' (array); selecting multiple table rows then calling the single-row update; reusing a binding from a bulk action.","solutions":["For Update Single Row, bind to a single object: {{ JSON.stringify(Table1.selectedRow) }} (no array).","If updating many rows, switch the command to the bulk Update Rows action.","Coerce an array of length 1 to its first element: {{ JSON.stringify(arr[0]) }}.","Pre-validate: JSON.parse(value) returns a non-array object."],"exampleFix":"// Before (array passed to single-row update)\n{{ JSON.stringify(Table1.selectedRows) }}\n\n// After (single row)\n{{ JSON.stringify(Table1.selectedRow) }}\n// or take the first:\n{{ JSON.stringify((Table1.selectedRows || [])[0]) }}","handlingStrategy":"type-guard","validationCode":"function pickRowObject(value) {\n  if (Array.isArray(value)) return value.length === 1 ? value[0] : null; // single-row action\n  if (value && typeof value === 'object') return value;\n  return null;\n}\nconst row = pickRowObject(Table1.selectedRows || Table1.selectedRow);\nif (!row) showAlert('Select a single row to update', 'error');\nelse UpdateRow.run({ rowObjects: JSON.stringify(row) });","typeGuard":"function isSingleRowObject(v) {\n  return v != null && typeof v === 'object' && !Array.isArray(v);\n}","tryCatchPattern":null,"preventionTips":["For Update Single Row, always bind to a single object, never an array.","Use the bulk action for arrays of rows.","Coerce [onlyRow] to onlyRow before binding."],"tags":["appsmith","google-sets","validation","json-shape","row-update","type-mismatch"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}