{"record":{"id":"dae61ee9044ffee9","repo":"pentaho/pentaho-kettle","slug":"transexecutor-exception-unabletofindfield","errorCode":null,"errorMessage":"TransExecutor.Exception.UnableToFindField","messagePattern":"TransExecutor\\.Exception\\.UnableToFindField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/SubtransExecutor.java","lineNumber":153,"sourceCode":"    subTrans.copyParametersFrom( this.subtransMeta );\n    subTrans.setPreview( this.parentTrans.isPreview() );\n    TransStepUtil.initServletConfig( this.parentTrans, subTrans );\n    return subTrans;\n  }\n\n  private void passParametersToTrans( Trans internalTrans, RowMetaAndData rowMetaAndData ) throws KettleException {\n    internalTrans.clearParameters();\n    String[] parameterNames = internalTrans.listParameters();\n\n    for ( int i = 0; i < this.parameters.getVariable().length; ++i ) {\n      String variable = this.parameters.getVariable()[ i ];\n      String fieldName = this.parameters.getField()[ i ];\n      String inputValue = this.parameters.getInput()[ i ];\n      String value;\n      if ( !Utils.isEmpty( fieldName ) ) {\n        int idx = rowMetaAndData.getRowMeta().indexOfValue( fieldName );\n        if ( idx < 0 ) {\n          throw new KettleException(\n            BaseMessages.getString( PKG, \"TransExecutor.Exception.UnableToFindField\", fieldName ) );\n        }\n\n        value = rowMetaAndData.getString( idx, \"\" );\n      } else {\n        value = this.parentTrans.environmentSubstitute( inputValue );\n      }\n\n      if ( Const.indexOfString( variable, parameterNames ) < 0 ) {\n        internalTrans.setVariable( variable, Const.NVL( value, \"\" ) );\n      } else {\n        internalTrans.setParameterValue( variable, Const.NVL( value, \"\" ) );\n      }\n    }\n\n    internalTrans.activateParameters();\n  }\n","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/SubtransExecutor.java#L135-L171","documentation":"SubtransExecutor.passParametersToTrans() maps fields from the executor's input row into the executed sub-transformation's parameters. For each configured parameter field name, it looks up the field in rowMetaAndData; if the field name is not found in the row metadata, this KettleException is thrown.","triggerScenarios":"TransExecutor (or SubtransExecutor.execute) configured with a field name in the parameters mapping that does not exist in the row being passed to the sub-transformation.","commonSituations":"The executing transformation's row layout changed (field renamed/dropped) after configuring the sub-transformation parameter mapping; mismatch between the configured 'field value' source column and actual stream fields.","solutions":["In the TransExecutor step's Parameters tab, set each field to an existing column of the incoming stream","Preview the stream feeding the executor to confirm the field names","Remove the field name (leave it empty) and use a static input value with environment substitution instead"],"exampleFix":"// before\nparameters.getField()[0] = \"oldOrderId\";\n// after\nparameters.getField()[0] = \"orderId\"; // exists in input row","handlingStrategy":"validation","validationCode":"for (String f : parameters.getField()) {\n  if (!Utils.isEmpty(f) && rowMeta.indexOfValue(f) < 0) {\n    throw new IllegalArgumentException(\"Parameter field '\" + f + \"' missing from input row\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try { subtransExecutor.execute(row); } catch (KettleException e) { log.error(\"Parameter field lookup failed: \" + e.getMessage()); }","preventionTips":["Preview the executor's input stream after schema changes","Keep parameter field mappings synchronized with upstream field definitions","Prefer static values with variables when the field is not guaranteed"],"tags":["kettle","transexecutor","parameters","row-metadata"],"backgroundTag":"resource-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"}