{"record":{"id":"867b5c630bdcb98b","repo":"pentaho/pentaho-kettle","slug":"propertyinput-exception-couldnotfindfield","errorCode":null,"errorMessage":"PropertyInput.Exception.CouldnotFindField","messagePattern":"PropertyInput\\.Exception\\.CouldnotFindField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/propertyinput/PropertyInput.java","lineNumber":362,"sourceCode":"          data.totalpreviousfields = data.inputRowMeta.size();\n\n          // Create convert meta-data objects that will contain Date & Number formatters\n          data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );\n\n          // Check is filename field is provided\n          if ( Utils.isEmpty( meta.getDynamicFilenameField() ) ) {\n            logError( BaseMessages.getString( PKG, \"PropertyInput.Log.NoField\" ) );\n            throw new KettleException( BaseMessages.getString( PKG, \"PropertyInput.Log.NoField\" ) );\n          }\n\n          // cache the position of the field\n          if ( data.indexOfFilenameField < 0 ) {\n            data.indexOfFilenameField = getInputRowMeta().indexOfValue( meta.getDynamicFilenameField() );\n            if ( data.indexOfFilenameField < 0 ) {\n              // The field is unreachable !\n              logError( BaseMessages.getString( PKG, \"PropertyInput.Log.ErrorFindingField\" )\n                + '[' + meta.getDynamicFilenameField() + ']' );\n              throw new KettleException( BaseMessages.getString(\n                PKG, \"PropertyInput.Exception.CouldnotFindField\", meta.getDynamicFilenameField() ) );\n            }\n          }\n        } // End if first\n\n        String filename = getInputRowMeta().getString( data.readrow, data.indexOfFilenameField );\n        if ( log.isDetailed() ) {\n          logDetailed( BaseMessages.getString( PKG, \"PropertyInput.Log.FilenameInStream\", meta\n            .getDynamicFilenameField(), filename ) );\n        }\n\n        data.file = KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( filename, getTransMeta() );\n        // Check if file exists!\n      }\n\n      data.filename = KettleVFS.getFilename( data.file );\n\n      // Add additional fields?","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/propertyinput/PropertyInput.java#L344-L380","documentation":"In openNextFile(), when reading filenames from an incoming field, this is thrown if the configured dynamic filename field cannot be found in the input row metadata (indexOfValue returns -1). The field name in the message is the one that could not be located.","triggerScenarios":"The step's 'Filename field' names a column that does not exist in the row arriving from the previous step — renamed upstream, wrong case, or the field was removed from the Select/Text File Output upstream.","commonSituations":"Upstream step renamed or dropped the column; step copied between transformations whose row layouts differ; field name typo or case mismatch (e.g. 'FileName' vs 'filename').","solutions":["Fix the 'Filename field' in the step dialog to match the actual incoming column name exactly","Check the upstream step's output fields (row layout) and keep the column name stable","Add a Select Values step to (re)name or restore the field before Property Input","Use 'Preview' on the previous step to confirm the field exists and its exact name"],"exampleFix":"// before: field renamed upstream, step still expects old name\nmeta.setDynamicFilenameField(\"fname\");\n// after\nmeta.setDynamicFilenameField(\"filename\"); // matches upstream Select Values rename","handlingStrategy":"validation","validationCode":"RowMetaInterface in = prevStep.getStepMetaInterface().getTableFields(); // or preview row meta\nif (in.indexOfValue(meta.getDynamicFilenameField()) < 0) {\n  throw new IllegalStateException(\"Field \" + meta.getDynamicFilenameField() + \" not in incoming rows\");\n}","typeGuard":"boolean fieldPresent = inputRowMeta.indexOfValue(fieldName) >= 0;","tryCatchPattern":"try {\n  transformation.execute(params);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().contains(\"CouldnotFindField\")) {\n    logError(\"Filename field not found in input rows; check upstream step\");\n  } else { throw e; }\n}","preventionTips":["Keep upstream column names stable; rename deliberately via Select Values","Match field name case exactly as produced upstream","Preview the previous step's output rows before running end-to-end","Recheck the mapping after copying steps between transformations"],"tags":["kettle","row-metadata","field-lookup"],"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"}