Import Conditional Logic Values

Is there any way to import an excel sheet of conditional values?

Like here I can add them manually but I have thousands I need to add.

There is no way to import any conditional logic rules. But maybe you don’t need to use conditional logic in that way. What are you trying to accomplish exactly?

Hi Chris,

Thanks for the reply.

I have a sweepstakes form I need to create.

The client is giving away 2.5 million product codes for validation.

When someone has this code, they go to the website and the 1st field they will see is “Enter Code”

If one of the 2.5 million codes are entered, then I will show additional fields like name, phone, email, etc. and then they will be able to submit the form. If the incorrect code is entered, it will say “incorrect code”

Is there a way to accomplish this?

I was checking out this article - Conditional logic with a data set could be the right direction?

Cheers.

Yes, that is a much better idea. Use a database to store the data, and the gform_validation filter to check the database for the code before continuing. I actually put together that code in the pastebin over eight years ago and it probably still works.

I would recommend using a database though, rather than a flat file.

Also, rather than even performing the lookup, are there enough unique codes that you can validate them by algorithm? I don’t imagine the codes are sequential, where I could guess that 10000003 is valid if 10000002 was already valid. :man_shrugging:

It would be an algorithm similar to how a credit card is validated, or a SIM/ICCID number is validated: https://en.wikipedia.org/wiki/Luhn_algorithm

Do anything you can to keep that validation out of the form builder :slight_smile:

Heya,

Okay! Is there an article I can refer to when trying to accomplish this?

Or any other resources you can point me to?

Thank you!

Hey Chris,

Realized I didn’t answer one of your questions. The validation codes are random.

If I figure out how to use a database for the codes, is there a way to remove the code once validated from the database or possibly add a marker so that we know it’s been used already and cannot be used again?