Prevent duplicates in combination with other fields

Hi,

hope you can help me with that:

Is there a way to combine the “no duplicates” validator with other fields?
So the duplicate error message for one field should only fire if two fields have duplicates.

Example:

This is an already existing submission: Field 1 = 1234 Field 2 = ABCD

New entry: Field 1 = 1234 Field 2 = EFGH -> Submission OK

New entry: Field 1 = 5678 Field 2 = ABCD -> Submission OK

New entry: Field 1 = 1234 Field 2 = ABCD -> Submission ERROR

Thanks four your help!

Bye,
Michael

Hi Michael. The “No Duplicates” setting will apply to just one field at a time. If you want to ensure that a combination of fields has not been previously submitted, you can use the gform_validation filter to combine the submitted values into one string, and then retrieve values from the database from previous entries, combine those, and compare to what is currently being submitted.

Here is the documentation for the gform_validation filter:

To retrieve previously submitted data from the database, you could use our API functions:

That may be overly complex and I have another idea if that does not appeal to you :slight_smile:

Thank you very much Chris, that would have been too complex for me :wink:

Just helped myself out with Gravity Perks Limit Submissions and this works just fine! :slight_smile:

Awesome. Thank you for the update.