{"record":{"id":"fc784b77e1b2704b","repo":"pentaho/pentaho-kettle","slug":"no-name-was-specified-for-result-value","errorCode":null,"errorMessage":"No name was specified for result value #","messagePattern":"No name was specified for result value #","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMod.java","lineNumber":487,"sourceCode":"      throw new KettleValueException( BaseMessages.getString( PKG, \"ScriptValuesMod.Log.JavascriptError\" ), e );\n    }\n    return bRC;\n  }\n\n  public Object getValueFromJScript( Object result, int i ) throws KettleValueException {\n    String fieldName = meta.getFieldname()[ i ];\n    if ( !Utils.isEmpty( fieldName ) ) {\n      // res.setName(meta.getRename()[i]);\n      // res.setType(meta.getType()[i]);\n\n      try {\n        return ( result == null ) ? null\n          : JavaScriptUtils.convertFromJs( result, meta.getType()[ i ], fieldName );\n      } catch ( Exception e ) {\n        throw new KettleValueException( BaseMessages.getString( PKG, \"ScriptValuesMod.Log.JavascriptError\" ), e );\n      }\n    } else {\n      throw new KettleValueException( \"No name was specified for result value #\" + ( i + 1 ) );\n    }\n  }\n\n  public RowMetaInterface getOutputRowMeta() {\n    return data.outputRowMeta;\n  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n\n    meta = (ScriptValuesMetaMod) smi;\n    data = (ScriptValuesModData) sdi;\n\n    Object[] r = getRow(); // Get row from input rowset & set row busy!\n    if ( r == null ) {\n      // Modification for Additional End Function\n      try {\n        if ( data.cx != null ) {\n          // Checking for EndScript","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/scriptvalues_mod/ScriptValuesMod.java#L469-L505","documentation":"Thrown by getValueFromJScript() when a result value entry has no field name configured. If meta.getFieldname()[i] is null or empty, the method cannot label or store the converted value and throws a KettleValueException 'No name was specified for result value #N' (1-based index). This is a step-metadata configuration error, not a script problem.","triggerScenarios":"The Modified Java Script Value step defines a result field whose 'Field name' column is blank; during valueData() the empty name is detected in getValueFromJScript for index i.","commonSituations":"User added a row in the step's fields grid but left the name empty, an import/paste of step XML lost the fieldname attribute, or a programmatic meta construction (via API) skipped setting fieldnames.","solutions":["Open the Modified Java Script Value step dialog and fill in the missing Field name for row N","Remove the empty result-field row if the value is not needed","If building meta via API, call meta.setFieldname(...) with a non-empty name for every entry","Re-export/check the transformation XML to ensure fieldname attributes are present","Validate step metadata with the step's built-in verification before running"],"exampleFix":"// before: meta built without a name\nmeta.allocate( 1 );\nmeta.getFieldname()[ 0 ] = null;\n// after\nmeta.allocate( 1 );\nmeta.getFieldname()[ 0 ] = \"resultValue\";","handlingStrategy":"validation","validationCode":"// Validate all result field names are non-empty before running the transformation\nString[] names = meta.getFieldname();\nfor ( int i = 0; i < names.length; i++ ) {\n  if ( names[ i ] == null || names[ i ].trim().isEmpty() ) {\n    throw new IllegalStateException( \"Result field #\" + ( i + 1 ) + \" has no name\" );\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  runTransformation();\n} catch ( KettleValueException e ) {\n  if ( e.getMessage().startsWith( \"No name was specified for result value\" ) ) {\n    logError( \"Fix the empty Field name in the Modified Java Script Value step\" );\n  }\n  throw e;\n}","preventionTips":["Never leave the Field name column blank in the step's fields grid","Run the step dialog's field verification before saving","When constructing meta via API, always set a non-empty fieldname per entry"],"tags":["configuration","metadata","missing-name","step-config"],"backgroundTag":"missing-required-argument","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"}