Find id of element on already made google form?

后端 未结 2 888
小蘑菇
小蘑菇 2020-12-15 01:25

I have a form made on google docs, and I have a script that I\'ve just created (that isn\'t complete) that will analyze the responses on the form, and validate them based on

相关标签:
2条回答
  • 2020-12-15 01:38

    Something like this will show you the ids in the logger...

    var form = FormApp.getActiveForm();
    var items = form.getItems();
    for (var i in items) { 
      Logger.log(items[i].getTitle() + ': ' + items[i].getId());
    }
    

    To see the IDs manually in Chrome >> View Form >> right-click on the question Label >> Inspect element >> look for the for="entry_XXXXXXX" attribute. That 'xxxxxxx' will be the id.

    0 讨论(0)
  • 2020-12-15 01:49

    An update to Bryan P's answer:

    To find the ID:

    • view the form (as if you were taking it)
    • right click and inspect the question name
    • look for either:
      • data-item-id="##########", or
      • aria-describedby="i.desc.########## i3"

    You want the ##########.

    0 讨论(0)
提交回复
热议问题