{"record":{"id":"20859013d3806235","repo":"pentaho/pentaho-kettle","slug":"it-was-not-possible-to-find-table-tablenamefield-in-the","errorCode":null,"errorMessage":"It was not possible to find table [<tablenameField>] in the input fields.","messagePattern":"It was not possible to find table \\[<tablenameField>\\] in the input fields\\.","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/synchronizeaftermerge/SynchronizeAfterMerge.java","lineNumber":670,"sourceCode":"      return false;\n    }\n\n    if ( first ) {\n      first = false;\n      data.outputRowMeta = getInputRowMeta().clone();\n      data.inputRowMeta = data.outputRowMeta;\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      if ( meta.istablenameInField() ) {\n        // Cache the position of the table name field\n        if ( data.indexOfTableNameField < 0 ) {\n          data.indexOfTableNameField = data.inputRowMeta.indexOfValue( meta.gettablenameField() );\n          if ( data.indexOfTableNameField < 0 ) {\n            String message =\n              \"It was not possible to find table [\" + meta.gettablenameField() + \"] in the input fields.\";\n            logError( message );\n            throw new KettleStepException( message );\n          }\n        }\n      } else {\n        data.realTableName = environmentSubstitute( meta.getTableName() );\n        if ( Utils.isEmpty( data.realTableName ) ) {\n          throw new KettleStepException( \"The table name is not specified (or the input field is empty)\" );\n        }\n        data.realSchemaTable =\n          data.db.getDatabaseMeta().getQuotedSchemaTableCombination( data.realSchemaName, data.realTableName );\n      }\n\n      // Cache the position of the operation order field\n      if ( data.indexOfOperationOrderField < 0 ) {\n        data.indexOfOperationOrderField = data.inputRowMeta.indexOfValue( meta.getOperationOrderField() );\n        if ( data.indexOfOperationOrderField < 0 ) {\n          String message =\n            \"It was not possible to find operation field [\" + meta.getOperationOrderField()\n              + \"] in the input stream!\";","sourceCodeStart":652,"sourceCodeEnd":688,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/synchronizeaftermerge/SynchronizeAfterMerge.java#L652-L688","documentation":"Thrown during processRow() initialization when 'table name defined in a field' is enabled but the configured table-name field cannot be found among the input row's fields (indexOfValue returns -1). The step logs the message and throws a KettleStepException before processing any rows.","triggerScenarios":"meta.istablenameInField() is true; data.inputRowMeta.indexOfValue(meta.gettablenameField()) < 0 — i.e. the field name typed in the dialog does not exist in the incoming stream (typo, renamed upstream, case mismatch, field removed).","commonSituations":"Upstream step renamed or dropped the column; user typed the field name with wrong case or extra spaces; connecting the step to a different hop than intended; metadata ETL migration where the field mapping changed.","solutions":["Open the step dialog and re-select the table-name field from the actual input fields (fix typo/case).","Check the previous step's output fields (preview) to confirm the field exists with the exact name.","If upstream was changed, add a 'Select values' step to rename/recreate the expected field.","If the table is actually static, disable 'table name defined in a field' and enter the table name directly."],"exampleFix":"// before (dialog)\ntablenameField: \"TableName \"  // trailing space\n// after\ntablenameField: \"TableName\"","handlingStrategy":"validation","validationCode":"// In the dialog/metadata, assert the field exists in the input layout\nList<String> fields = inputRowMeta.getFieldNames();\nif (!fields.contains(tableNameField)) {\n  throw new ValidationException(\"Field not in input stream: \" + tableNameField);\n}","typeGuard":null,"tryCatchPattern":"catch (KettleStepException e) {\n  if (e.getMessage().contains(\"not possible to find table\")) {\n    logError(\"Check the table-name field setting against upstream fields.\");\n  }\n  throw e;\n}","preventionTips":["Re-select dialog fields from the live input metadata after upstream changes.","Avoid hand-typing field names; use field pickers to prevent typos/case errors.","Preview the upstream step output before running the transformation."],"tags":["configuration","missing-field","pentaho-kettle"],"backgroundTag":"field-not-found-in-stream","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"}