I want to run a contest with a number of predefined codes. Is there any way to make a query and if the entry matches one of those codes it can be sent, otherwise it will mark an error?
Your use case for checking predefined codes and taking a different course of action is similar to another community forum that I put together a video on - Check out
Viewing a Previously Uploaded File - #3 by JamieO
In your case, if using the conditional routing to send the successful entry submitter to one notification vs a non-successful either none or a unsuccessful message doesn’t fit, you could also use gform-field_validation to check the contents of the code field before submission is allowed.