{"record":{"id":"3ef3fa07c4c7851d","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-valuename-in-the-row","errorCode":null,"errorMessage":"Unable to find '<valueName>' in the row","messagePattern":"Unable to find '<valueName>' in the row","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/RowMetaAndData.java","lineNumber":428,"sourceCode":"          return converter.number2long( vn );\n        } else if ( boolean.class.isAssignableFrom( destinationType ) ) {\n          return converter.number2booleanPrimitive( vn );\n        } else if ( Boolean.class.isAssignableFrom( destinationType ) ) {\n          return converter.number2boolean( vn );\n        } else if ( destinationType.isEnum() ) {\n          return converter.number2enum( destinationType, vn );\n        } else {\n          throw new RuntimeException( \"Wrong value conversion to \" + destinationType );\n        }\n    }\n\n    throw new KettleValueException( \"Unknown conversion from \" + metaType.getTypeDesc() + \" into \" + destinationType );\n  }\n\n  public void removeValue( String valueName ) throws KettleValueException {\n    int index = rowMeta.indexOfValue( valueName );\n    if ( index < 0 ) {\n      throw new KettleValueException( \"Unable to find '\" + valueName + \"' in the row\" );\n    }\n    removeValue( index );\n  }\n\n  public void removeValue( int index ) {\n    rowMeta.removeValueMeta( index );\n    data = RowDataUtil.removeItem( data, index );\n  }\n\n  public void mergeRowMetaAndData( RowMetaAndData rowMetaAndData, String originStepName ) {\n    int originalMetaSize = rowMeta.size();\n    rowMeta.mergeRowMeta( rowMetaAndData.getRowMeta(), originStepName );\n    data = RowDataUtil.addRowData( data, originalMetaSize, rowMetaAndData.getData() );\n  }\n}\n","sourceCodeStart":410,"sourceCodeEnd":444,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/RowMetaAndData.java#L410-L444","documentation":"removeValue(String) looks up the field index via rowMeta.indexOfValue(); if the field name is absent it throws this KettleValueException instead of silently ignoring the removal. It protects callers from assuming a column existed and was deleted.","triggerScenarios":"Calling removeValue(\"name\") when the row has no column with that exact name — typo, case mismatch, field already removed, or the field was never produced upstream.","commonSituations":"Cleanup code removing temporary fields that a previous transformation version produced; double-invoked removal; fields removed earlier by a Select Values step.","solutions":["Check field existence before removing: rowMeta.indexOfValue(valueName) >= 0","Correct the field name spelling/case","Make removal idempotent by guarding the call or catching KettleValueException","Verify upstream steps still emit the field"],"exampleFix":"// before\nrow.removeValue(\"tempField\");\n// after\nif ( row.getRowMeta().indexOfValue(\"tempField\") >= 0 ) {\n  row.removeValue(\"tempField\");\n}","handlingStrategy":"validation","validationCode":"String[] names = row.getRowMeta().getFieldNames();\nboolean exists = java.util.Arrays.asList(names).contains(valueName);\nif (!exists) {\n  log.warn(\"Skip removeValue: field \" + valueName + \" not present\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  row.removeValue(valueName);\n} catch (KettleValueException e) {\n  if (e.getMessage().contains(\"Unable to find\")) {\n    log.warn(\"Field already absent: \" + valueName);\n  } else throw e;\n}","preventionTips":["Check indexOfValue(valueName) >= 0 before removing","Make cleanup code idempotent so double-removal is safe","Track which fields your step added so removal matches creation","Compare with rowMeta.getFieldNames() to confirm exact spelling/case"],"tags":["kettle","rowmeta","field-not-found"],"backgroundTag":"record-not-found","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"}