Field validation by pulling info from Google Sheets

I couldn’t find any information on a cursory search of the forums; please forgive me if it has been covered.

I am generating a first survey (of many) using form-builder. There are multiple pages to this form, but in the first page I have to validate that the user is authorized to go further. I will implement a page-counter function and it will not allow the user to proceed past page 1 unless they are validated. This question is about the validation process.

I plan on having a google-sheet that contains all the names of people allowed to use this survey (about 6000 people). In that sheet will be their names, but also registration numbers.

Is there a way to, through javascript in the form, and maybe some GAS script in the g-sheet, have the form gain access to that g-sheet, search for a name, and pull the corresponding number/email that is on the sheet?

Then, from there, I can simply check that the number/email the user provided matches what was pulled and either flag them as validated or not.

Second concern: could I also gain access to that g-sheet to update the row of data (lets say I have the user’s registration number, but they just offered their email as secondary validation…it would be nice to write that information to the g-sheet for future validation.

Is this possible? Is this easily possible? Is this possible if I pay someone with mad skillz to do it?

Cheers

John

1 Like

Oh yeah…I am nearly a complete novice with JS and GAS-script…but I learn fast, especially if it involves cutting/pasting/tweaking donated code.

1 Like

Happy to see you on our forum, @John_Gudgeon! Welcome :wave:

Do I understand right that you’d like to automatically pull the registration numbers from the spreadsheet to the field marked in the screenshot after users entered their First and Last name?

1 Like

I want the users to put their number in there, and then I would wish to pull the “true information” from the spreadsheet and see if they match…almost like a user-name and password situation.

1 Like

Ah, I see, sorry for misunderstanding!

I’ll discuss it with the devs and get back to you tomorrow :wink:

1 Like

Thank you…the more I think about it…it would be identical to a password situation, but the user doesn’t have the option to determine their number, nor ever change it. Its not high security, but its secure enough for what it needs to be.

1 Like

As an update from my own investigations…I think I have found a solution as offered in this video: https://youtu.be/cRwpTv33Z_g?si=XRdKjI3WyISJr82j

While I haven’t been able to work my way through to fully understanding this, and thus being able to use it with ease, I have been able to run the scripts presented in the SQL section of this video, and it does seem to pull data from the google sheet as a fetch of the whole row.

Later today I will put this code from visual studio into the custom JS section of form-builder, so you can have a look.

Cheers

John

1 Like

Hi there, @John_Gudgeon! :wave:

I’ve discussed your use case with the devs, and unfortunately, it’s not possible to implement this feature at the moment.

The video you shared demonstrates how to retrieve data from a Google spreadsheet, and while it’s not too complex, there’s currently no way to validate the field, even using the Custom JS option. I’m really sorry about that!

We’ve added your idea to the Wishlist, and if it gets more votes, we’ll try to explore this possibility in the future :slightly_smiling_face: