Is there someone who didn't have the case to verify that a field value is unique per form type/business entity/step(s)? I for my part now, did implement this dozens of times
Finally, I realized, that I should streamline this approach and create a business rule for this. Even if it's easy to create the check, the business rule will force you to think about each parameter
You can read up on the business rule and the parameters: here.