{"record":{"id":"e48acca0da70cc72","repo":"pentaho/pentaho-kettle","slug":"getpreviousrowfield-exception-outputfieldempty","errorCode":null,"errorMessage":"GetPreviousRowField.Exception.OutputFieldEmpty","messagePattern":"GetPreviousRowField\\.Exception\\.OutputFieldEmpty","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"plugins/get-previous-row-field/core/src/main/java/org/pentaho/di/trans/steps/getpreviousrowfield/GetPreviousRowField.java","lineNumber":98,"sourceCode":"      data.outputRowMeta = data.inputRowMeta.clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n\n      data.inStreamNrs = new int[meta.getFieldInStream().length];\n      for ( int i = 0; i < meta.getFieldInStream().length; i++ ) {\n        data.inStreamNrs[i] = data.inputRowMeta.indexOfValue( meta.getFieldInStream()[i] );\n        if ( data.inStreamNrs[i] < 0 ) { // couldn't find field!\n\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"GetPreviousRowField.Exception.FieldRequired\", meta.getFieldInStream()[i] ) );\n        }\n      }\n\n      data.outStreamNrs = new String[meta.getFieldInStream().length];\n      for ( int i = 0; i < meta.getFieldInStream().length; i++ ) {\n        data.outStreamNrs[i] = meta.getFieldOutStream()[i];\n        if ( Utils.isEmpty( data.outStreamNrs[i] ) ) {\n          throw new KettleStepException( BaseMessages.getString(\n            PKG, \"GetPreviousRowField.Exception.OutputFieldEmpty\", \"\" + i ) );\n        }\n      }\n    } // end if first\n\n    try {\n      Object[] outputRow = getOutputRowData( r );\n\n      putRow( data.outputRowMeta, outputRow ); // copy row to output rowset(s);\n\n      if ( checkFeedback( getLinesRead() ) ) {\n        if ( log.isDetailed() ) {\n          logDetailed( BaseMessages.getString( PKG, \"GetPreviousRowField.Log.LineNumber\" ) + getLinesRead() );\n        }\n      }\n    } catch ( KettleException e ) {\n      boolean sendToErrorRow = false;\n      String errorMessage = null;","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/get-previous-row-field/core/src/main/java/org/pentaho/di/trans/steps/getpreviousrowfield/GetPreviousRowField.java#L80-L116","documentation":"Each configured field in GetPreviousRowField must have a non-empty output (target) field name. During processRow's first-run initialization, an empty output name for any field index throws a KettleStepException with this localized message, including the zero-based field index.","triggerScenarios":"Executing the transformation with a row in the step's fields grid whose output-field column is blank.","commonSituations":"Adding a field row but forgetting to type the new field name; importing metadata where out_stream_name was empty; copying step config with partial fields.","solutions":["Fill in the output field name for every row in the step's fields table","Remove unused/blank field rows from the grid","Re-save the step after editing to persist the corrected names"],"exampleFix":"// before (fields grid)\nin: amount   out: (empty)\n// after\nin: amount   out: prev_amount","handlingStrategy":"validation","validationCode":"for (int i = 0; i < meta.getFieldOutStream().length; i++) { if (Utils.isEmpty(meta.getFieldOutStream()[i])) { throw new IllegalArgumentException(\"Output field name empty at index \" + i); } }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fill every output-field cell when adding rows to the fields grid","Delete unused blank rows","Run the step dialog's validation/check before saving","Name outputs with a consistent prefix convention"],"tags":["etl","step-configuration","validation"],"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"}