获取条目ID,该条目ID用于预填充Google表单URL中的字段(项目) [英] get Entry ID which is used to pre-populate fields (Items) in a Google Form URL

查看:117
本文介绍了获取条目ID,该条目ID用于预填充Google表单URL中的字段(项目)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:这个问题不是不是关于查找项目(表单元素)的ID,而是关于条目的ID.这些是不同的东西.条目ID是一个数字,用于预填充表单URL中的字段(项目).

NOTE: This question is not about finding ID of an Item (form element), but an ID of Entry. These are different things. Entry ID is a number which is used to pre-populate fields (Items) in a form URL.

如此处所述 https://developers.google.com/apps-script/reference/forms/text-item 可以通过getID()方法获取TextItem ID(实际上是任何Item ID).

As described here https://developers.google.com/apps-script/reference/forms/text-item it is possible to get a TextItem ID (actually, any Item ID) via getID() method.

如果打开任何公开的Google Form HTML源代码,您将在var FB_PUBLIC_LOAD_DATA中看到类似的内容:

If you open any public Google Form HTML source code you will see something like this in the var FB_PUBLIC_LOAD_DATA:

[232495719,"Question 1",null,0,[[1492883199]]
 ^                               ^
 Item ID                         Entry ID

我看不到获取条目ID 的方法.实际上可以通过Google Apps Script API进行吗?

I don't see a method to get Entry IDs. Is it actually possible to do via Google Apps Script API?

推荐答案

有两种获取条目ID的方法

There are two ways to get the entry IDs

  1. 来自预填充的URL.
    • 为此,您有两个选择:
  1. From the pre-filled URL.
    • For this, you have two options:
  1. 从表单编辑器或
  2. 获取预填充的URL 通过使用 toPrefilledUrl()获取预填充的URL a> Google Apps脚本方法.
  1. get the prefilled URL from the Form editor or
  2. get the prefilled URL by using toPrefilledUrl() Google Apps Script method.

  • 为此,您应该转到表单的源代码.如果您的表单使用小节,这可能会很棘手,因为可能不会有任何页面显示所有条目ID.

这篇关于获取条目ID,该条目ID用于预填充Google表单URL中的字段(项目)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆