{"record":{"id":"8170dc5d5aa5d1ba","repo":"pentaho/pentaho-kettle","slug":"propertyoutput-log-filenameinfieldempty","errorCode":null,"errorMessage":"PropertyOutput.Log.FilenameInFieldEmpty","messagePattern":"PropertyOutput\\.Log\\.FilenameInFieldEmpty","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/propertyoutput/PropertyOutput.java","lineNumber":91,"sourceCode":"      if ( data.indexOfKeyField < 0 ) {\n        // The field is unreachable !\n        logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta.getKeyField() ) );\n        throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta.getKeyField() ) );\n      }\n\n      // Let's take the index of Key field ...\n      data.indexOfValueField = data.inputRowMeta.indexOfValue( meta.getValueField() );\n      if ( data.indexOfValueField < 0 ) {\n        // The field is unreachable !\n        logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta.getValueField() ) );\n        throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta.getValueField() ) );\n      }\n\n      if ( meta.isFileNameInField() ) {\n        String realFieldName = environmentSubstitute( meta.getFileNameField() );\n        if ( Utils.isEmpty( realFieldName ) ) {\n          logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameInFieldEmpty\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameInFieldEmpty\" ) );\n        }\n        data.indexOfFieldfilename = data.inputRowMeta.indexOfValue( realFieldName );\n        if ( data.indexOfFieldfilename < 0 ) {\n          // The field is unreachable !\n          logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta.getValueField() ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.ErrorFindingField\", meta\n            .getValueField() ) );\n        }\n      } else {\n        // Let's check for filename...\n        data.filename = buildFilename();\n        // Check if filename is empty..\n        if ( Utils.isEmpty( data.filename ) ) {\n          logError( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameEmpty\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"PropertyOutput.Log.FilenameEmpty\" ) );\n        }\n        openNewFile();\n      }","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/propertyoutput/PropertyOutput.java#L73-L109","documentation":"When the Property Output step is configured with 'filename defined in a field', the filename is taken from a stream field. On the first row, if the configured filename field (after environmentSubstitute) is null or empty, the step logs this error and throws a KettleException because it has no way to determine which file to write.","triggerScenarios":"processRow() with meta.isFileNameInField()==true and environmentSubstitute(meta.getFileNameField()) returning an empty string — i.e. 'Filename in field' is checked but the filename field name setting is blank or its variable resolves to empty (lines 87-92).","commonSituations":"'Take filename from field' enabled but the field name never filled in; ${OUTPUT_FILE_FIELD} variable not defined in the environment/kettle.properties; variable typed with a typo so it resolves to empty; copying the step from another transformation without updating the variable.","solutions":["Open the Property Output dialog and set the 'filename field' to a real incoming field name.","Define the referenced variable (e.g. in kettle.properties or transformation properties) so it no longer resolves to empty.","Uncheck 'filename defined in a field' if you intend to use a static filename instead.","Validate the setting in a transformation unit test before deployment."],"exampleFix":"// before\n<filename_in_field>true</filename_in_field>\n<filename_field>${UNDEFINED_VAR}</filename_field>\n// after\nOUTPUT_FILE_FIELD=target_file  # kettle.properties\ne.g. <filename_field>target_file</filename_field>","handlingStrategy":"validation","validationCode":"if (propertyOutputMeta.isFileNameInField()\n    && Utils.isEmpty(propertyOutputMeta.environmentSubstitute(propertyOutputMeta.getFileNameField()))) {\n  throw new KettleException(\"Filename field name is empty; set it or disable 'filename in field'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(transName);\n} catch (KettleException e) {\n  if (String.valueOf(e.getMessage()).contains(\"FilenameInFieldEmpty\")) {\n    logError(\"Property Output: filename-in-field is enabled but the field name is empty/undefined\");\n  }\n}","preventionTips":["Never enable 'filename in field' without filling in the field name.","Define all variables referenced in field names in kettle.properties or transformation settings.","Run a transformation-level check/verification before production runs.","Document required variables for deployments."],"tags":["kettle","etl","configuration","empty-field","property-output"],"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"}