{"record":{"id":"8d07bbaed07307d0","repo":"pentaho/pentaho-kettle","slug":"getxmldata-exception-couldnotfindfield-localized-message","errorCode":null,"errorMessage":"GetXMLData.Exception.CouldnotFindField (localized message with field name)","messagePattern":"GetXMLData\\.Exception\\.CouldnotFindField \\(localized message with field name\\)","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLData.java","lineNumber":377,"sourceCode":"        }\n\n        // For String to <type> conversions, we allocate a conversion meta data row as well...\n        //\n        data.convertRowMeta = data.outputRowMeta.cloneToType( ValueMetaInterface.TYPE_STRING );\n\n        // Check is XML field is provided\n        if ( Utils.isEmpty( meta.getXMLField() ) ) {\n          logError( BaseMessages.getString( PKG, \"GetXMLData.Log.NoField\" ) );\n          throw new KettleException( BaseMessages.getString( PKG, \"GetXMLData.Log.NoField\" ) );\n        }\n\n        // cache the position of the field\n        if ( data.indexOfXmlField < 0 ) {\n          data.indexOfXmlField = getInputRowMeta().indexOfValue( meta.getXMLField() );\n          if ( data.indexOfXmlField < 0 ) {\n            // The field is unreachable !\n            logError( BaseMessages.getString( PKG, \"GetXMLData.Log.ErrorFindingField\", meta.getXMLField() ) );\n            throw new KettleException( BaseMessages.getString( PKG, \"GetXMLData.Exception.CouldnotFindField\", meta\n                .getXMLField() ) );\n          }\n        }\n      }\n\n      if ( meta.isInFields() ) {\n        // get XML field value\n        String Fieldvalue = getInputRowMeta().getString( data.readrow, data.indexOfXmlField );\n\n        if ( log.isDetailed() ) {\n          logDetailed( BaseMessages.getString( PKG, \"GetXMLData.Log.XMLStream\", meta.getXMLField(), Fieldvalue ) );\n        }\n\n        if ( meta.getIsAFile() ) {\n          FileObject file = null;\n          try {\n            // XML source is a file.\n            file = KettleVFS.getInstance( getTransMeta().getBowl() )","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/xml/core/src/main/java/org/pentaho/di/trans/steps/getxmldata/GetXMLData.java#L359-L395","documentation":"Thrown by ReadNextString when the configured XML source field cannot be found in the incoming row stream: getInputRowMeta().indexOfValue(meta.getXMLField()) returns -1. The step logs 'ErrorFindingField' with the field name and throws this KettleException including the field name.","triggerScenarios":"The 'XML field' name set in the step does not match any field of the input row at runtime — upstream step renamed/removed the field, a case mismatch, or the step's row metadata changed after the field name was entered.","commonSituations":"Renaming a column in an upstream step (e.g. Text File Input or Table Input) without updating GetXMLData; field name typed with wrong casing; feeding the step from a stream that no longer emits the XML column; reordering steps so GetXMLData runs before the field is added.","solutions":["Compare the field name in the step dialog with the actual incoming row fields (view input metadata / 'Preview' the upstream step) and fix the name or casing.","Re-select the field from the dropdown in the step dialog instead of typing it, so it binds to real stream metadata.","If an upstream step conditionally drops the field, make its presence guaranteed before GetXMLData runs."],"exampleFix":"// before\nmeta.setXMLField( \"XmlString\" ); // upstream field is actually 'xml_string'\n// after\nint idx = getInputRowMeta().indexOfValue( \"xml_string\" );\nif ( idx < 0 ) {\n  throw new KettleException( \"Field xml_string not found in input row\" );\n}\nmeta.setXMLField( \"xml_string\" );","handlingStrategy":"validation","validationCode":"RowMetaInterface in = transMeta.getPrevStepFields(stepMeta);\nif (in.indexOfValue(meta.getXMLField()) < 0) {\n  throw new IllegalStateException(\"Field \" + meta.getXMLField()\n      + \" not found in input row of GetXMLData\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"CouldnotFindField\")) {\n    logError(\"Upstream row no longer contains field; check upstream renames\");\n  } else { throw e; }\n}","preventionTips":["Re-select fields from the dropdown after changing upstream steps.","Use 'Check transformations' (F9 metadata check) before running.","Avoid renaming stream fields without searching for downstream references.","Keep field names case-consistent across steps."],"tags":["kettle","row-metadata","field-mapping","xml-input"],"backgroundTag":"resource-not-found","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"}