{"record":{"id":"3697ee481edc0604","repo":"pentaho/pentaho-kettle","slug":"excelinput-exception-invalidtypelabel","errorCode":"ExcelInput.Exception.InvalidTypeLabel","errorMessage":"ExcelInput.Exception.InvalidTypeLabel","messagePattern":"ExcelInput\\.Exception\\.InvalidTypeLabel","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java","lineNumber":341,"sourceCode":"          .getType() == ValueMetaInterface.TYPE_BOOLEAN ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ExcelInput.Exception.InvalidTypeBoolean\", v\n            .getTypeDesc() ) );\n        }\n        break;\n\n      case DATE:\n        if ( !( v.getType() == ValueMetaInterface.TYPE_STRING || v.getType() == ValueMetaInterface.TYPE_NONE || v\n          .getType() == ValueMetaInterface.TYPE_DATE ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ExcelInput.Exception.InvalidTypeDate\", cell\n            .getContents(), v.getTypeDesc() ) );\n        }\n        break;\n\n      case LABEL:\n        if ( v.getType() == ValueMetaInterface.TYPE_BOOLEAN\n          || v.getType() == ValueMetaInterface.TYPE_DATE || v.getType() == ValueMetaInterface.TYPE_INTEGER\n          || v.getType() == ValueMetaInterface.TYPE_NUMBER ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ExcelInput.Exception.InvalidTypeLabel\", cell\n            .getContents(), v.getTypeDesc() ) );\n        }\n        break;\n\n      case EMPTY:\n        // OK\n        break;\n\n      case NUMBER:\n        if ( !( v.getType() == ValueMetaInterface.TYPE_STRING\n          || v.getType() == ValueMetaInterface.TYPE_NONE || v.getType() == ValueMetaInterface.TYPE_INTEGER\n          || v.getType() == ValueMetaInterface.TYPE_BIGNUMBER || v.getType() == ValueMetaInterface.TYPE_NUMBER ) ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"ExcelInput.Exception.InvalidTypeNumber\", cell\n            .getContents(), v.getTypeDesc() ) );\n        }\n        break;\n\n      default:","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java#L323-L359","documentation":"ExcelInput.checkType() throws this KettleException when an Excel cell contains a LABEL (text) but the field's declared type is Boolean, Date, Integer, or Number. Text cells cannot be delivered to those target types without an explicit conversion.","triggerScenarios":"fillRow() encounters a label (string) cell while the mapped field is defined as Boolean, Date, Integer, or Number in the step metadata.","commonSituations":"Columns that previously held numbers now contain text (stray spaces, headers row in data, quoted values), or the field type was changed to Number/Date while Excel treats values as text.","solutions":["Change the field's Type to String in the Excel Input step and convert downstream with 'Select values' (metadata type change) or 'Calculator'","Clean the source sheet so the column contains real numbers/dates instead of text","If the target type is correct, ensure Excel stores the cells as numeric/date, not text (remove apostrophes/quotes)","Check for a header row included in the data range; exclude it from the sheet's rows range"],"exampleFix":"// before\nfield: columnName=amount, type=Number  // cell contains '1234 ' as text\n// after\nfield: columnName=amount, type=String\n// then: Select Values step -> amount -> Type=Number, non-strict","handlingStrategy":"validation","validationCode":"int cellType = cell.getType();\nint fieldType = v.getType();\nboolean bad = cellType == KCellType.LABEL\n  && ( fieldType == ValueMetaInterface.TYPE_BOOLEAN\n    || fieldType == ValueMetaInterface.TYPE_DATE\n    || fieldType == ValueMetaInterface.TYPE_INTEGER\n    || fieldType == ValueMetaInterface.TYPE_NUMBER );\nif ( bad ) { /* read as String and convert downstream */ }","typeGuard":"boolean acceptsLabelCell( ValueMetaInterface v ) {\n  int t = v.getType();\n  return t != ValueMetaInterface.TYPE_BOOLEAN\n    && t != ValueMetaInterface.TYPE_DATE\n    && t != ValueMetaInterface.TYPE_INTEGER\n    && t != ValueMetaInterface.TYPE_NUMBER;\n}","tryCatchPattern":"try {\n  row = excelInput.fillRow( cells, ... );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"InvalidTypeLabel\" ) ) {\n    // set field type to String; add a Select values/Calculator conversion step\n  }\n}","preventionTips":["Keep numeric/date columns free of text contamination (spaces, quotes, header rows)","Exclude header rows from the sheet data range","Use String + downstream conversion when input text quality is uncertain"],"tags":["pdi","excel-input","type-mismatch","text-vs-number"],"backgroundTag":"type-mismatch","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}