Using data from sheet for form

廉价感情. 提交于 2019-12-12 02:44:44

问题


I have a google sheet where I've created a form (survey) using scripting. In that sheet, I've assigned x number of users a unique user id (e.g. DR8371 or JH3059) to help keep track of who's taken the survey and what their answers are (this is not meant to be anonymous). However, I can't figure out how to attach the user id from the sheet to the form (the sheet contains the form responses though). The first question on the form asks what the user's ID is, and I don't want the form to submit the responses unless the user ID is correct. Is there a way do this? The user ID's need to stay on the sheet where I currently have them stored.


回答1:


You can prefill an input field in a Google Form with the ID and distribute the resulting pre-filled URL out to the right user. However, the user can always delete or change the value. There are no hidden field types to protect against that either. Also, hiding a input field on a page the user can't navigate to seems to return an empty response for that field instead of keeping the pre-filled value.

You could use a regular expression in the field's advanced validation as a "check" to whether the ID matches a range or the exact number you want. However, we can't currently set or update any validation via scripts ( see and vote for Issue 4216 ) so you would have to keep doing that manually.

If you absolutely want to prevent a pre-filled id from being changed by the user, that may require creating a separate Google Form for each user with advanced validation setup to match just 1 id.

There's also no ability to for a script to "check" whether the ID is right as the user fills out the form. See this post for more on that.



来源:https://stackoverflow.com/questions/32914206/using-data-from-sheet-for-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!