{"record":{"id":"8dd730491213e5e4","repo":"pentaho/pentaho-kettle","slug":"mappinginput-exception-unabletofindmappedvalue","errorCode":"MappingInput.Exception.UnableToFindMappedValue","errorMessage":"Unable to connect find mapped value with name '{0}'.","messagePattern":"Unable to connect find mapped value with name '(.+?)'\\.","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/mappinginput/MappingInput.java","lineNumber":115,"sourceCode":"\n      // The Input RowMetadata is not the same as the output row meta-data.\n      // The difference is described in the data interface\n      //\n      // String[] data.sourceFieldname\n      // String[] data.targetFieldname\n      //\n      // --> getInputRowMeta() is not corresponding to what we're outputting.\n      // In essence, we need to rename a couple of fields...\n      //\n      data.outputRowMeta = getInputRowMeta().clone();\n\n      // Now change the field names according to the mapping specification...\n      // That means that all fields go through unchanged, unless specified.\n      //\n      for ( MappingValueRename valueRename : data.valueRenames ) {\n        ValueMetaInterface valueMeta = data.outputRowMeta.searchValueMeta( valueRename.getSourceValueName() );\n        if ( valueMeta == null ) {\n          throw new KettleStepException( BaseMessages.getString( PKG, \"MappingInput.Exception.UnableToFindMappedValue\",\n              valueRename.getSourceValueName() ) );\n        }\n        valueMeta.setName( valueRename.getTargetValueName() );\n\n        valueMeta = getInputRowMeta().searchValueMeta( valueRename.getSourceValueName() );\n        if ( valueMeta == null ) {\n          throw new KettleStepException( BaseMessages.getString( PKG, \"MappingInput.Exception.UnableToFindMappedValue\",\n              valueRename.getSourceValueName() ) );\n        }\n        valueMeta.setName( valueRename.getTargetValueName() );\n      }\n\n      // This is typical side effect of ESR-4178\n      data.outputRowMeta.setValueMetaList( data.outputRowMeta.getValueMetaList() );\n      this.getInputRowMeta().setValueMetaList( this.getInputRowMeta().getValueMetaList() );\n\n      // The input row meta has been manipulated correctly for the call to meta.getFields(), so create a blank\n      // outputRowMeta","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/mappinginput/MappingInput.java#L97-L133","documentation":"During the first pass of processRow, the Mapping Input step applies the configured field renames (MappingValueRename) to its output row metadata. If a rename spec references a source field name that does not exist in the incoming row metadata, this KettleStepException is thrown. It signals a mismatch between the mapping's field-mapping definition and the fields actually produced by the parent transformation.","triggerScenarios":"data.outputRowMeta.searchValueMeta(valueRename.getSourceValueName()) returns null while iterating data.valueRenames — i.e., a MappingValueRename whose sourceValueName is absent from the parent's row layout.","commonSituations":"Parent transformation's field layout changed (renamed/deleted a field) after the mapping definition was saved; wrong hop wired into the Mapping step; copy-pasted mapping parameters pointing at stale field names; case-sensitive field name mismatches.","solutions":["Open the Mapping step settings in the parent transformation and correct/remove the field mapping whose source field no longer exists.","Regenerate the field mappings: re-select the sub-transformation so fields are re-scanned from the actual output.","Verify the upstream step in the parent transformation still produces the expected field (check its output preview).","Check field name spelling/case in the MappingValueRename definitions."],"exampleFix":"// before: stale rename in mapping spec\nnew MappingValueRename(\"old_amount\", \"amount\");\n// after: match the actual upstream field name\nnew MappingValueRename(\"amount_in\", \"amount\");","handlingStrategy":"validation","validationCode":"RowMetaInterface upstream = parentTrans.getStepFields(mappingSourceStepMeta);\nfor (MappingValueRename r : valueRenames) {\n  if (upstream.searchValueMeta(r.getSourceValueName()) == null) {\n    throw new IllegalStateException(\"Field not produced upstream: \" + r.getSourceValueName());\n  }\n}","typeGuard":"boolean fieldExists(RowMetaInterface rowMeta, String name) { return rowMeta != null && name != null && rowMeta.searchValueMeta(name) != null; }","tryCatchPattern":"try {\n  trans.waitUntilFinished();\n} catch (KettleStepException e) {\n  if (e.getMessage().contains(\"Unable to connect find mapped value\")) {\n    // parse field name from message, fix Mapping step field mappings\n  }\n  throw e;\n}","preventionTips":["Re-generate mapping field definitions after any upstream field rename/delete.","Preview upstream step output before finalizing mapping parameters.","Keep field names consistent (case, whitespace) between parent and sub-transformation.","Use the 'Get Fields' button in the Mapping dialogs instead of typing names."],"tags":["kettle","pdi","field-mapping","row-metadata","rename"],"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"}