{"record":{"id":"7ce17bcb2bce6326","repo":"pentaho/pentaho-kettle","slug":"no-data-output-data-type-was-specified-for-new-field","errorCode":null,"errorMessage":"No data output data type was specified for new field [${fieldName}]","messagePattern":"No data output data type was specified for new field \\[(.+?)\\]","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/core/util/JavaScriptUtils.java","lineNumber":66,"sourceCode":"        return jsToInteger( value, value.getClass() );\n\n      case ValueMetaInterface.TYPE_STRING:\n        return jsToString( value, classType );\n\n      case ValueMetaInterface.TYPE_DATE:\n        return jsToDate( value, classType );\n\n      case ValueMetaInterface.TYPE_BOOLEAN:\n        return value;\n\n      case ValueMetaInterface.TYPE_BIGNUMBER:\n        return jsToBigNumber( value, classType );\n\n      case ValueMetaInterface.TYPE_BINARY:\n        return Context.jsToJava( value, byte[].class );\n\n      case ValueMetaInterface.TYPE_NONE:\n        throw new KettleValueException( \"No data output data type was specified for new field [\"\n          + fieldName + \"]\" );\n\n      default:\n        return Context.jsToJava( value, Object.class );\n    }\n  }\n\n  public static Number jsToNumber( Object value, String classType ) {\n    if ( classType.equalsIgnoreCase( JS_UNDEFINED ) ) {\n      return null;\n    } else if ( classType.equalsIgnoreCase( JS_NATIVE_JAVA_OBJ ) ) {\n      try {\n        // Is it a java Value class ?\n        Value v = (Value) Context.jsToJava( value, Value.class );\n        return v.getNumber();\n      } catch ( Exception e ) {\n        String string = Context.toString( value );\n        return Double.parseDouble( Const.trim( string ) );","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/util/JavaScriptUtils.java#L48-L84","documentation":"JavaScriptUtils.convertFromJs() converts a Rhino/Nashorn JS value to a Java object for a target field. When the target field's type is ValueMetaInterface.TYPE_NONE (no output data type specified), the switch has no conversion to apply and throws KettleValueException with this message. It means a JavaScript step's new output field lacks a declared data type.","triggerScenarios":"A JavaScript step (Modified Java Script Value) defines a new output field whose ValueMeta has type TYPE_NONE — i.e. the field's type was left as 'None'/unspecified — and convertFromJs is invoked on that field.","commonSituations":"Transformation designer added a field in the script but never set the output field type in the step's fields grid (left as 'None'); upgrade or copy-paste dropped the type metadata; dynamic field creation without specifying type.","solutions":["Set an explicit data type (String, Number, Date, BigNumber, Boolean, Binary) for the new field in the JavaScript step's output fields list.","In the script, explicitly type the field if using APIs that register fields, rather than leaving type NONE.","Review the transformation metadata (XML/ktr) to ensure <type> is not NONE/0 for that field."],"exampleFix":"// before (step field config)\nfieldName=outputField, type=None\n// after\nfieldName=outputField, type=String // (or Number/Date/BigNumber as required)","handlingStrategy":"validation","validationCode":"if (field.getType() == ValueMetaInterface.TYPE_NONE) {\n  throw new KettleException(\"Output field '\" + field.getName() + \"' has no data type; set String/Number/Date/etc.\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  Object result = JavaScriptUtils.convertFromJs(context, value, fieldName, classType);\n} catch (KettleValueException e) {\n  throw new KettleException(\"Set a data type for field \" + fieldName + \" in the JavaScript step fields grid\", e);\n}","preventionTips":["Always assign an explicit type to every output field in the Modified Java Script Value step.","Review transformation XML/ktr for <type>0</type> (NONE) entries after copy-paste or upgrades.","Use the step's 'Get variables'/type detection features so fields get concrete types."],"tags":["javascript","type-conversion","etl","configuration"],"backgroundTag":"missing-required-config-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"}