{"record":{"id":"89657cb4673f3377","repo":"pentaho/pentaho-kettle","slug":"excelinput-exception-invalidtypeboolean","errorCode":"ExcelInput.Exception.InvalidTypeBoolean","errorMessage":"ExcelInput.Exception.InvalidTypeBoolean","messagePattern":"ExcelInput\\.Exception\\.InvalidTypeBoolean","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java","lineNumber":324,"sourceCode":"    }\n    // Add RootUri\n    if ( !Utils.isEmpty( meta.getRootUriField() ) ) {\n      r[rowIndex] = data.rootUriName;\n      rowIndex++;\n    }\n\n    return r;\n  }\n\n  private void checkType( KCell cell, ValueMetaInterface v ) throws KettleException {\n    if ( !meta.isStrictTypes() ) {\n      return;\n    }\n    switch ( cell.getType() ) {\n      case BOOLEAN:\n        if ( !( v.getType() == ValueMetaInterface.TYPE_STRING || v.getType() == ValueMetaInterface.TYPE_NONE || v\n          .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() ) );","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/excel/core/src/main/java/org/pentaho/di/trans/steps/excelinput/ExcelInput.java#L306-L342","documentation":"ExcelInput.checkType() throws this KettleException when an Excel cell contains a BOOLEAN but the corresponding field's ValueMeta has an incompatible data type. Only String, None (unspecified), or Boolean target types can receive a boolean cell; anything else aborts row processing.","triggerScenarios":"fillRow() processing a boolean cell whose mapped field is defined in the step metadata as Integer, Number, Date, BigNumber, etc. — the declared field type in the Excel Input step does not accept booleans.","commonSituations":"Excel column contents changed after the step metadata was defined (TRUE/FALSE now appears where numbers used to be), or the field type was edited to Number while the sheet still emits TRUE/FALSE.","solutions":["Open the Excel Input step and change the field's Type to String, Boolean, or leave it unspecified","If the field must stay numeric, fix the source sheet so the column no longer contains TRUE/FALSE values","Add a conversion step (e.g. 'Value Mapper' or 'If') downstream after reading the boolean as String/Boolean","Re-run 'Preview rows' in the step dialog to confirm the detected cell type matches field types"],"exampleFix":"// before (field meta)\nfield: columnName=isActive, type=Integer\n// after\nfield: columnName=isActive, type=Boolean   // or String, then convert downstream","handlingStrategy":"validation","validationCode":"int cellType = cell.getType(); // KCellType.BOOLEAN etc.\nint fieldType = v.getType();\nboolean ok = cellType == KCellType.BOOLEAN\n  && ( fieldType == ValueMetaInterface.TYPE_STRING\n    || fieldType == ValueMetaInterface.TYPE_NONE\n    || fieldType == ValueMetaInterface.TYPE_BOOLEAN );\nif ( !ok ) { /* fix field type in step metadata first */ }","typeGuard":"boolean acceptsBooleanCell( ValueMetaInterface v ) {\n  int t = v.getType();\n  return t == ValueMetaInterface.TYPE_STRING\n    || t == ValueMetaInterface.TYPE_NONE\n    || t == ValueMetaInterface.TYPE_BOOLEAN;\n}","tryCatchPattern":"try {\n  row = excelInput.fillRow( cells, ... );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"InvalidTypeBoolean\" ) ) {\n    // coerce field to String/Boolean in step metadata and rerun\n  }\n}","preventionTips":["Align Excel Input field types with the actual sheet cell types via Preview rows","Avoid editing field types without re-checking source sheet contents","Handle TRUE/FALSE columns as Boolean or String, converting downstream"],"tags":["pdi","excel-input","type-mismatch","data-types"],"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"}