{"record":{"id":"28b35bbab6cda9fa","repo":"pentaho/pentaho-kettle","slug":"filterrows-checkresult-fieldsnotfoundfrompreviousstep","errorCode":"FilterRows.CheckResult.FieldsNotFoundFromPreviousStep","errorMessage":"FilterRows.CheckResult.FieldsNotFoundFromPreviousStep","messagePattern":"FilterRows\\.CheckResult\\.FieldsNotFoundFromPreviousStep","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/filterrows/FilterRows.java","lineNumber":181,"sourceCode":"    }\n    return false;\n  }\n\n  protected void checkNonExistingFields() throws KettleException {\n    List<String> orphanFields = meta.getOrphanFields(\n      meta.getCondition(), getInputRowMeta() );\n    if ( orphanFields != null && orphanFields.size() > 0 ) {\n      String fields = \"\";\n      boolean first = true;\n      for ( String field : orphanFields ) {\n        if ( !first ) {\n          fields += \", \";\n        }\n        fields += \"'\" + field + \"'\";\n        first = false;\n      }\n      String errorMsg = BaseMessages.getString( PKG, \"FilterRows.CheckResult.FieldsNotFoundFromPreviousStep\", fields );\n      throw new KettleException( errorMsg );\n    }\n  }\n}\n","sourceCodeStart":163,"sourceCodeEnd":185,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/filterrows/FilterRows.java#L163-L185","documentation":"During transformation validation, FilterRows.checkNonExistingFields verifies that every field referenced by the filter condition exists in the previous step's row metadata. If any are missing it builds a comma-separated list and throws this KettleException naming the fields that the previous step does not provide.","triggerScenarios":"check() -> checkNonExistingFields(): one or more fields used in the FilterRows Condition are absent from the incoming row metadata (prev RowMetaInterface), producing message 'fields not found from previous steps'.","commonSituations":"Upstream step renamed or removed a field; condition configured against fields from a step that is no longer the direct predecessor; typo in the condition's field list; transformation edited programmatically.","solutions":["Read the error message's field list and re-open the Filter dialog to remove/re-select those fields from the actual incoming fields.","Fix the upstream step so it outputs the missing fields (check its own configuration/preview).","Use the 'Get fields' button in the condition editor so the field names match the current input metadata exactly."],"exampleFix":"// before: condition references field 'cust_id'\n// after: upstream Select Values step aliases 'customer_id' -> 'cust_id',\n// or change the condition to use 'customer_id'","handlingStrategy":"validation","validationCode":"// Check condition fields exist in the previous step's output before execution:\nRowMetaInterface prev = transMeta.getPrevStepFields(stepMeta);\nfor (String field : ((FilterRowsMeta) stepMeta.getStepMeta()).getCondition().getUsedFields()) {\n  if (prev.searchValueMeta(field) == null) {\n    throw new IllegalStateException(\"Filter references missing field: \" + field);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.checkSteps(remarks, ...);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"FieldsNotFoundFromPreviousStep\")) {\n    log.error(\"Fix filter condition fields: \" + e.getMessage(), e);\n  }\n  throw e;\n}","preventionTips":["Always populate the condition via the dialog's field list ('Get fields').","Run transformation checks (Ctrl+T validate) before executing.","Re-verify conditions after changing any upstream step's output fields."],"tags":["kettle","validation","field-lookup"],"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"}