{"record":{"id":"d876cfc2b8f6c88c","repo":"pentaho/pentaho-kettle","slug":"unable-to-pass-the-new-row-to-the-next-step-s-because-of-an-d876cf","errorCode":null,"errorMessage":"Unable to pass the new row to the next step(s) because of an error: ","messagePattern":"Unable to pass the new row to the next step\\(s\\) because of an error: ","errorType":"exception","errorClass":"RhinoRuntimeError","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesAddedFunctions.java","lineNumber":2026,"sourceCode":"  // put a row out to the next steps...\n  //\n  public static void putRow( Context actualContext, Scriptable actualObject, Object[] ArgList,\n    Function FunctionContext ) {\n    if ( ArgList.length == 1 ) {\n      try {\n        Object[] newRow = (Object[]) Context.jsToJava( ArgList[0], ( new Object[] {} ).getClass() );\n\n        Object scmO = actualObject.get( \"_step_\", actualObject );\n        try {\n          ScriptValuesMod step = (ScriptValuesMod) Context.jsToJava( scmO, ScriptValuesMod.class );\n          step.putRow( step.getOutputRowMeta(), newRow );\n        } catch ( Exception e ) {\n          ScriptValuesModDummy step = (ScriptValuesModDummy) Context.jsToJava( scmO, ScriptValuesModDummy.class );\n          step.putRow( step.getOutputRowMeta(), newRow );\n        }\n\n      } catch ( Exception e ) {\n        throw Context.reportRuntimeError( \"Unable to pass the new row to the next step(s) because of an error: \"\n          + Const.CR + e.toString() );\n      }\n    } else {\n      throw Context\n        .reportRuntimeError( \"The function call putRow requires 1 argument : the output row data (Object[])\" );\n    }\n  }\n\n  public static void deleteFile( Context actualContext, Scriptable actualObject, Object[] ArgList,\n    Function FunctionContext ) {\n\n    try {\n      if ( ArgList.length == 1 && !isNull( ArgList[0] ) && !isUndefined( ArgList[0] ) ) {\n        // Object act = actualObject.get(\"_step_\", actualObject);\n        // ScriptValuesMod act = (ScriptValuesMod)Context.toType(scm_delete, ScriptValuesMod.class);\n\n        FileObject fileObject = null;\n","sourceCodeStart":2008,"sourceCodeEnd":2044,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesAddedFunctions.java#L2008-L2044","documentation":"putRow(newRow) forwards a constructed row to the next steps via the bound step object; if the row push fails at any point (step lookup, metadata access, putRow call), the implementation throws this Rhino runtime error with the underlying exception appended. It signals the script could not emit the row downstream.","triggerScenarios":"Calling putRow(Object[]) when '_step_' cannot be resolved, output row metadata is unavailable, or the downstream putRow call throws (e.g. transformation stopping, row shape inconsistent with metadata).","commonSituations":"Building rows whose field count/types don't match the output metadata; calling putRow during initialization before metadata exists; using putRow in steps without downstream hops configured.","solutions":["Ensure the new row matches getOutputRowMeta() field count and types.","Call putRow only during row processing, not in the script's init phase.","Confirm the step has a connected output hop and the transformation is running normally.","Read the appended exception (after Const.CR) for the root cause."],"exampleFix":"// before\nputRow([f1]); // output meta expects 3 fields\n// after\nvar row = createRowCopy(3);\nrow[2] = 'new value';\nputRow(row);","handlingStrategy":"try-catch","validationCode":"// match row shape to output metadata before putRow\nvar meta = getOutputRowMeta();\nif (newRow.length !== meta.size()) throw new Error('row field count mismatch');","typeGuard":null,"tryCatchPattern":"try { putRow(newRow); } catch (e) { logError('putRow failed: ' + e.message); }","preventionTips":["Build rows via createRowCopy to preserve metadata shape.","Only call putRow during row processing with a connected output hop.","Validate field count/types against getOutputRowMeta()."],"tags":["javascript","row-manipulation","pentaho"],"backgroundTag":"shape-mismatch","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"}