Filtering Data based on ReferenceField

I can see some errors in this code and I’m going to try to clear it up.