Is there a way to check if some record exists before I create a new one?

Thank you very much for this, I really do appreciate it. I have edited my first question in a more complete question (before you responded me) in Not filterBy properly; and I have given complete code. If you can found an error, or correct me somewhere please do. Because I feel I am close to solution. Thank you in advance!