google-apps-scriptgoogle-appsgoogle-forms

get Entry ID which is used to pre-populate fields (Items) in a Google Form 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.

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.

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

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


Solution

  • There are two ways to get the entry IDs

    1. From the pre-filled URL.
      • For this, you have two options:
        1. get the prefilled URL from the Form editor or
        2. get the prefilled URL by using toPrefilledUrl() Google Apps Script method.
    2. From the form response view.
      • For this, you should go to the source code of the form. If your form use sections, this could be tricky because it's possible that will not be any page showing all the entries IDs.