{"record":{"id":"ea0afd4d5595dafe","repo":"pentaho/pentaho-kettle","slug":"tableoutputdialog-failedtofindfield-message","errorCode":"TableOutputDialog.FailedToFindField.Message","errorMessage":"TableOutputDialog.FailedToFindField.Message","messagePattern":"TableOutputDialog\\.FailedToFindField\\.Message","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputHelper.java","lineNumber":146,"sourceCode":"      }\n    }\n    return prev;\n  }\n\n  private RowMetaInterface processSpecifiedFieldsIfNeeded( TableOutputMeta info, RowMetaInterface prev )\n    throws KettleStepException {\n    if ( info.specifyFields() ) {\n      // Only use the fields that were specified.\n      RowMetaInterface prevNew = new RowMeta();\n\n      for ( int i = 0; i < info.getFieldDatabase().length; i++ ) {\n        ValueMetaInterface insValue = prev.searchValueMeta( info.getFieldStream()[ i ] );\n        if ( insValue != null ) {\n          ValueMetaInterface insertValue = insValue.clone();\n          insertValue.setName( info.getFieldDatabase()[ i ] );\n          prevNew.addValueMeta( insertValue );\n        } else {\n          throw new KettleStepException( BaseMessages.getString(\n            PKG, \"TableOutputDialog.FailedToFindField.Message\", info.getFieldStream()[ i ] ) );\n        }\n      }\n      prev = prevNew;\n    }\n    return prev;\n  }\n\n  private AutoIncrementData addAutoIncrementFieldIfNeeded( TableOutputMeta info, RowMetaInterface prev ) {\n    boolean autoInc = false;\n    String pk = null;\n\n    if ( info.isReturningGeneratedKeys() && !Utils.isEmpty( info.getGeneratedKeyField() ) ) {\n      ValueMetaInterface valueMeta = new ValueMetaInteger( info.getGeneratedKeyField() );\n      valueMeta.setLength( 15 );\n      prev.addValueMeta( 0, valueMeta );\n      autoInc = true;\n      pk = info.getGeneratedKeyField();","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tableoutput/TableOutputHelper.java#L128-L164","documentation":"Thrown in TableOutputHelper.processSpecifiedFieldsIfNeeded when a stream field named in the step's field mapping (info.getFieldStream()) cannot be found in the incoming row metadata (prev.searchValueMeta returns null). The Table Output step maps stream fields to database columns, and this error means the mapping references a field that no longer exists upstream. It prevents building a consistent output row for the insert.","triggerScenarios":"Calling processSpecifiedFieldsIfNeeded (indirectly via sql/TableOutputMeta.getFields flow) when specifyFields is enabled and info.getFieldStream()[i] does not match any field name in the previous step's RowMeta (e.g. field renamed upstream, case mismatch, or field removed).","commonSituations":"A transformation was edited upstream (field renamed or deleted) while the Table Output mapping still references the old name; connecting a different step with different columns; case-sensitive field name mismatch between mapping and stream.","solutions":["Open the Table Output dialog and re-map the 'Stream field' column entries to fields that actually exist in the incoming stream.","Verify the previous step still outputs the expected fields (View > Input fields / preview the previous step).","Check for case mismatches between the mapping's stream name and the actual field name; Kettle field lookup by name is exact.","If the mapping is stale after renaming, delete and recreate the field mappings (Get Fields)."],"exampleFix":"// before (mapping references missing field)\nfieldStream = new String[] { \"cust_name\", \"old_field\" }; // old_field no longer produced\n// after\nfieldStream = new String[] { \"cust_name\", \"customer_name\" }; // matches upstream field","handlingStrategy":"validation","validationCode":"// before running, verify every mapped stream field exists\nfor (String streamField : meta.getFieldStream()) {\n  if (prev.searchValueMeta(streamField) == null) {\n    throw new IllegalArgumentException(\"Mapped stream field not in input: \" + streamField);\n  }\n}","typeGuard":null,"tryCatchPattern":"// catch KettleStepException around getFields/sql\ntry { meta.getFields(...); }\ncatch (KettleStepException e) {\n  if (e.getMessage().contains(\"FailedToFindField\")) { /* re-map fields */ }\n  else throw e;\n}","preventionTips":["Re-run 'Get Fields' in the Table Output dialog after editing upstream steps","Preview the previous step to confirm field names before saving the mapping","Keep field names consistent in case across steps"],"tags":["kettle","field-mapping","table-output","row-metadata"],"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"}