{"record":{"id":"bfc13d4934e7ad6f","repo":"pentaho/pentaho-kettle","slug":"regexeval-exception-errorresultfieldmissing","errorCode":null,"errorMessage":"RegexEval.Exception.ErrorResultFieldMissing","messagePattern":"RegexEval\\.Exception\\.ErrorResultFieldMissing","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/regexeval/RegexEval.java","lineNumber":82,"sourceCode":"      return false;\n    }\n\n    if ( first ) { // we just got started\n\n      first = false;\n\n      // get the RowMeta\n      data.outputRowMeta = getInputRowMeta().clone();\n      int captureIndex = getInputRowMeta().size();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      // Let's check that Result Field is given\n      if ( Utils.isEmpty( environmentSubstitute( meta.getResultFieldName() ) ) ) {\n        if ( !meta.isAllowCaptureGroupsFlagSet() ) {\n          // Result field is missing !\n          logError( BaseMessages.getString( PKG, \"RegexEval.Log.ErrorResultFieldMissing\" ) );\n          throw new KettleStepException( BaseMessages.getString(\n            PKG, \"RegexEval.Exception.ErrorResultFieldMissing\" ) );\n        }\n        data.indexOfResultField = -1;\n      } else {\n        if ( meta.isReplacefields() ) {\n          data.indexOfResultField = getInputRowMeta().indexOfValue( meta.getResultFieldName() );\n        }\n        if ( data.indexOfResultField < 0 ) {\n          data.indexOfResultField = getInputRowMeta().size();\n          captureIndex++;\n        }\n      }\n\n      // Check if a Field (matcher) is given\n      if ( meta.getMatcher() == null ) {\n        // Matcher is missing !\n        logError( BaseMessages.getString( PKG, \"RegexEval.Log.ErrorMatcherMissing\" ) );\n        throw new KettleStepException( BaseMessages.getString( PKG, \"RegexEval.Exception.ErrorMatcherMissing\" ) );","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/regexeval/RegexEval.java#L64-L100","documentation":"RegexEval.processRow throws KettleStepException when the Result Field Name is empty in the step configuration and capture groups are not allowed. The step needs a target field to write the regex match result into; without it the output row shape cannot be produced, so it logs RegexEval.Log.ErrorResultFieldMissing and fails the step.","triggerScenarios":"Executing a Regex Eval step whose 'Result field name' is blank while 'Allow capture groups' is unchecked — detected on the first processRow call before any row is processed.","commonSituations":"Creating the step and forgetting to type a result field name; metadata migrated between versions losing the field; disabling capture groups which makes the previously-optional result field mandatory.","solutions":["Open the Regex Eval step dialog and set a non-empty Result field name","Or enable 'Allow capture groups' if you only need capture-group output fields","Validate meta.getResultFieldName() before running the transformation"],"exampleFix":"// before\nRegexEvalMeta meta = (RegexEvalMeta) stepMeta.getStepMetaInterface();\nmeta.setResultFieldName(\"\");\n// after\nRegexEvalMeta meta = (RegexEvalMeta) stepMeta.getStepMetaInterface();\nif (meta.getResultFieldName() == null || meta.getResultFieldName().trim().isEmpty()) {\n  meta.setResultFieldName(\"matchResult\");\n}","handlingStrategy":"validation","validationCode":"RegexEvalMeta m = (RegexEvalMeta) stepMeta.getStepMetaInterface();\nboolean ok = (m.getResultFieldName() != null && !m.getResultFieldName().trim().isEmpty()) || m.isAllowCaptureGroupsFlagSet();\nif (!ok) throw new IllegalArgumentException(\"Result field name required unless capture groups are allowed\");","typeGuard":"boolean hasResultField(RegexEvalMeta m) { return m.getResultFieldName() != null && !m.getResultFieldName().trim().isEmpty(); }","tryCatchPattern":"try { trans.execute(...); } catch (KettleException e) { if (e.getMessage().contains(\"ErrorResultFieldMissing\")) { logError(\"Set the Regex Eval result field name in the step dialog\"); } throw e; }","preventionTips":["Always set a Result field name when creating Regex Eval steps","If you rely on capture groups only, explicitly enable the capture-groups option","Preview the step in Spoon before running production transformations"],"tags":["kettle","regex","validation","step-config"],"backgroundTag":"empty-required-field","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"}