{"record":{"id":"a2035751fe3c6cea","repo":"pentaho/pentaho-kettle","slug":"unable-to-find-field-in-the-input-fields","errorCode":null,"errorMessage":"Unable to find field [{}] in the input fields.","messagePattern":"Unable to find field \\[(.+?)\\] in the input fields\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/hl7/core/src/main/java/org/pentaho/di/trans/steps/hl7input/HL7Input.java","lineNumber":63,"sourceCode":"\n  public HL7Input( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta, Trans trans ) {\n    super( stepMeta, stepDataInterface, copyNr, transMeta, trans );\n  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n    meta = (HL7InputMeta) smi;\n    data = (HL7InputData) sdi;\n\n    Object[] r = getRow(); // get row, set busy!\n    if ( r == null ) { // no more input to be expected...\n      setOutputDone();\n      return false;\n    }\n\n    if ( first ) {\n      data.messageFieldIndex = getInputRowMeta().indexOfValue( meta.getMessageField() );\n      if ( data.messageFieldIndex < 0 ) {\n        throw new KettleException( \"Unable to find field [\" + meta.getMessageField() + \"] in the input fields.\" );\n      }\n\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n                      metaStore );\n\n      data.parser = new GenericParser();\n      data.parser.setValidationContext( new NoValidation() );\n    }\n\n    String messageString = getInputRowMeta().getString( r, data.messageFieldIndex );\n\n    try {\n      Message message = data.parser.parse( messageString );\n      List<HL7Value> values = HL7KettleParser.extractValues( message );\n\n      for ( HL7Value value : values ) {\n        Object[] output = RowDataUtil.createResizedCopy( r, data.outputRowMeta.size() );","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/hl7/core/src/main/java/org/pentaho/di/trans/steps/hl7input/HL7Input.java#L45-L81","documentation":"Thrown during the first row processed by the HL7Input step when the configured message field (meta.getMessageField()) cannot be found in the incoming row's field list (indexOfValue returns -1). The step needs to know which input column holds the raw HL7 message text it will parse.","triggerScenarios":"processRow() with first==true calls getInputRowMeta().indexOfValue(meta.getMessageField()) and it returns -1: the field name configured in the step dialog does not match any incoming field.","commonSituations":"Upstream step was renamed or removed so the source field no longer exists; field name typo or case mismatch; connecting the HL7Input step to a different hop after editing the transformation; upstream step emits fields generated at runtime that differ from design time.","solutions":["Open the HL7Input step dialog and re-select the message field from the actual incoming field list","Verify the upstream step actually outputs the configured field (use a 'Get fields' preview)","Fix field name case/spelling to match the incoming row exactly","Reconnect the correct previous hop if the step was wired to the wrong source"],"exampleFix":"// before (step XML/config)\n<message_field>mesage</message_field>\n// after\n<message_field>message</message_field>","handlingStrategy":"validation","validationCode":"int idx = inputRowMeta.indexOfValue(meta.getMessageField());\nif (idx < 0) { throw new KettleException(\"Field [\" + meta.getMessageField() + \"] missing from input rows\"); }","typeGuard":null,"tryCatchPattern":"try { step.processRow(); } catch (KettleException e) { if (e.getMessage().contains(\"Unable to find field\")) { /* reconfigure step field mapping */ } }","preventionTips":["Re-select fields in step dialogs after changing upstream steps","Use field-name-agnostic references cautiously; prefer explicit mapping refresh","Preview upstream rows before running the transformation","Keep field names stable across transformations"],"tags":["kettle","transformation","field-lookup","hl7"],"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"}