{"record":{"id":"52f857c09dd86602","repo":"pentaho/pentaho-kettle","slug":"tableoutputdialog-failedtofindfield-message-52f857","errorCode":null,"errorMessage":"TableOutputDialog.FailedToFindField.Message","messagePattern":"TableOutputDialog\\.FailedToFindField\\.Message","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/trans/steps/tableoutput/TableOutputDialog.java","lineNumber":1464,"sourceCode":"        int idx = prev.indexOfValue( info.getTableNameField() );\n        if ( idx >= 0 ) {\n          prev.removeValueMeta( idx );\n        }\n      }\n      StepMeta stepMeta = transMeta.findStep( stepname );\n\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\n      boolean autoInc = false;\n      String pk = null;\n\n      // Add the auto-increment field too if any is present.\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();\n      }","sourceCodeStart":1446,"sourceCodeEnd":1482,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/trans/steps/tableoutput/TableOutputDialog.java#L1446-L1482","documentation":"In TableOutputDialog's field-mapping logic, for each database insert field the code looks up the matching incoming stream field via prev.searchValueMeta(info.getFieldStream()[i]). If the lookup returns null — the named stream field is not present in the row metadata — this KettleStepException (TableOutputDialog.FailedToFindField.Message) is thrown naming the missing field.","triggerScenarios":"Opening/applying the Table Output dialog when a saved field mapping references an input stream field that no longer exists (renamed, removed upstream, or field order/type changed and cache is stale).","commonSituations":"Upstream step renamed a field after Table Output was configured; deleted a column; switching table output mapping between transformations; stale 'Enter mapping' metadata persisted in the transformation.","solutions":["Reopen the Table Output dialog and rebuild the field mapping (or use 'Enter mapping'/'Get fields' again)","Fix the upstream step so it produces the expected field name","Remove or remap the stale field in the Table Output mapping grid","Verify with 'Preview' on the previous step which fields actually arrive"],"exampleFix":"// before: mapping expects field \"cust_name\"\nString[] fieldStream = { \"cust_name\" }; // upstream renamed to customer_name -> throws\n// after\nString[] fieldStream = { \"customer_name\" }; // remapped to current upstream field","handlingStrategy":"validation","validationCode":"// Java: verify every mapped field exists in the incoming stream before applying\nfor ( String field : info.getFieldStream() ) {\n  if ( prev.searchValueMeta( field ) == null ) throw new IllegalStateException( \"Missing field: \" + field );\n}","typeGuard":"boolean allFieldsPresent = java.util.Arrays.stream( info.getFieldStream() ).allMatch( f -> prev.searchValueMeta( f ) != null );","tryCatchPattern":"try { applyMapping(); } catch ( KettleStepException e ) { new ErrorDialog( shell, \"Mapping failed\", \"Field not found in input\", e ); }","preventionTips":["Rebuild Table Output field mappings after upstream schema changes","Use 'Get fields' to regenerate mappings instead of manual entry","Preview upstream output to confirm field names before mapping"],"tags":["field-mapping","table-output","metadata","ui"],"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"}