Form field - Checking if value exists in a Gsheet column

  • 11 July 2020
  • 1 reply
  • 59 views

Hi there,

I’m looking to check the validity of a value entered in a form field.

The field can only take a limited possibilities of values, all stored in a Google Sheets colum. The list of values can dynamically evolve over the time (ie values can be added/removed from this colum).

I want to make sure that the value entered in the field belongs to the list of values possible:

  • If the value belongs to the list of values stored in my Google Sheets colum, then the form can ben sent
  • Otherwise, an error message appears

I’m looking for a Javascript script that would access my Google Spreadsheet, retrieve the values from the column and check if the value entered in the field belongs to this list of values.

Has anyone made a similar script before?

Any help is appreciated 🙂

Thanks!


1 reply

Surely a script will do the job, but I think you’d better use GTM with a regex table to perform the check.
Going to google sheet and back to the form will probably take too long and if something goes wrong, you will have need some error handling.

Alternatively, you can perhaps use a third party form - like typeform, jotform etc… - to perform this function automatically.

Reply