Unique field validation on Google forms

Using Google forms, data can be stored in a spreadsheet. Now I would like to apply validation in the Username field to avoid duplication. How to add UNIQUE confirmation to Google form field using Google script?

+5
source share
1 answer

I think it’s not possible to add confirmation for fields in the values ​​of a Google form using Google Apps Script directcly.

On the one hand, you can change the settings in the Google form itself if the value of the Username field matches the name of the user logging in to access this form. You can do this by checking the box "Allow only one response per person (login required)".

If the above solution does not apply to your requirement, the UiApp / Html service in Script applications will help you in creating custom forms.

You can create a custom form and write a custom function to get the Username field values ​​using the SpreadsheetApp class into an array. Before submitting the form, compare the Username field from the Google form with the list of username cell values ​​that we received in the array and check its uniqueness.

Hope this helps!

+2
source

Source: https://habr.com/ru/post/1206069/


All Articles