如何为Google表单输入分配唯一ID? [英] How to assign a unique ID to a google form input?
问题描述
Google表单-我已经建立了一个google表单,我想为每个完成的传入表单输入分配一个唯一的ID.我的意图是使用唯一ID作为我创建的另一个Google表单的输入,我将使用该ID链接两个已完成的表单.有没有更简单的方法可以做到这一点?
Google Forms - I have set up a google form and I want to assign a unique id each of the completed incoming form inputs. My intention is to use the unique ID as an input for another google form I have created which I will use to link the two completed forms. Is there another easier way to do this?
我不是程序员,但如有需要,我有可用的编程资源.
I'm not a programmer but I have programming resources available to me if needed.
推荐答案
我也为此大吃一惊,终于找到了解决方案.
I was also banging my head at this and finally found a solution.
我编写了一个6位数字,该数字会自动为每一行生成,并由以下内容组成:
I compose a 6-digit number that gets generated automatically for every row and is composed of:
-
行号的3位数字-具有唯一性(如果期望超过998个响应,则可以使用更多数字),并与
3 digits of the row number - that gives the uniqueness (you can use more if you expect more than 998 responses), concatenated with
时间戳的3位数字转换为数字-防止猜测数字
3 digits of the timestamp converted to a number - that prevents guessing the number
请遵循以下说明:
- 在电子表格中创建一个与您的表单链接的附加列,我们称其为唯一ID"
- 第1行应自动填充列标题
-
在第2行的唯一ID"列下,添加以下公式:
- Create an additional column in the spreadsheet linked to your form, let's call it: "unique ID"
- Row number 1 should be populated with column titles automatically
In row number 2, under column "Unique ID", add the following formula:
=arrayformula( if( len(A2:A), "" & text(row(A2:A) - row(A2) + 2, "000") & RIGHT(VALUE(A2:A), 3), iferror(1/0) ) )
注意:数组公式会自动应用于整个列.
Note: An array formula applies automatically to the entire column.
公式说明:
- A列通常应保存时间戳.如果 timestamp 不为空,则给出行号:
row(A2:A) - row(A2) + 2
- 使用
text
将其修整为3位数字. - 然后我将它与 timestamp 连接起来,并使用
VALUE
转换为数字,并使用RIGHT
将其修整为最右边的三个数字
- Column A should normally hold the timestamp. If the timestamp is not empty, then this gives the row number:
row(A2:A) - row(A2) + 2
- Using
text
I trim it to a 3-digit number. - Then I concatenate it with the timestamp converted to a number using
VALUE
and trim it to the three right-most digits usingRIGHT
Voila!一个既独特又难以猜测的数字(因为提交者无法访问时间戳).
Voila! A number that is both unique and hard-to-guess (as the submitter has no access to the timestamp).
如果您想要更多的信心,显然您可以为每个部分使用更多的数字.
If you would like more confidence, obviously you could use more digits for each of the parts.
这篇关于如何为Google表单输入分配唯一ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!