Filtering a dropdown where both field are Ref fields

Hi

Help please - I am a beginner - I trying to filter a dropdown as follows but I can’t get the Outcome to filter because Diagnosis and Outcome are Ref s in the app. I can’t get the right Valid If Filter condition - sometimes I get can’t compare a text and Ref fields. Does any one have an example of how I could work this please

Patient Table

Name Diagnosis Outcome

Bob X Bad
Fred X Good
Joy Y Poor

Two drop downs one for Diagnosis and One for Out come depending on Diagnosis

Diagnosis Table

Diagnosis Name
X
Y

Outcome Table

Diagnosis Outcome

X Good
X Bad
Y Good
Y Poor

Many Thanks