Pre-Populating Google Forms

So you’ve got your Google Form integrated with your WordPress site and it looks great.  Awesome.  You know what would make it more awesome?  If I could pre-populate the form with the default answers!  Guess what?  You can!  Google Docs has a Help Page on pre-populating Google Forms and you can use that guidance to pre-populate the forms you embed on your WordPress site with the WordPress Google Forms (aka wpGForm) plugin.

For example:  I have a Test Bed that I use when developing wpGForm.  Using the following short code, I can pre-populate the form with some answers.  Setting the default values does require you to look at the form detail, this is accomplished by looking at the HTML source for the field you’d like to pre-populate (using Google Chrome’s “Inspect Element” feature or something similar in FireFox or IE) and finding the “id” attribute for the field.  On the Test Bed form the first field asks for a name and it’s attribute id is “entry_0”.  All of the fields will have an attribute id with a similar name.

By using the short code below I am going to set the following fields:

  • Name (entry_0):  Brave Sir Robin
  • Quest (entry_1):  I seek the Holy Grail
[gform email='on' prefix='wpgform_' form='https://docs.google.com/spreadsheet/embeddedform?formkey=dEJ6cTZidDJPY3B3aW5XeEI4RWVsNnc6MQ&entry_0=Brave%20Sir%20Robin&entry_1=I%20seek%20the%20Holy%20Grail']

[gform email=’on’ prefix=’wpgform_’ form=’https://docs.google.com/spreadsheet/embeddedform?formkey=dEJ6cTZidDJPY3B3aW5XeEI4RWVsNnc6MQ&entry_0=Brave%20Sir%20Robin&entry_1=I%20seek%20the%20Holy%20Grail’ br=’on’]

2 thoughts on “Pre-Populating Google Forms

  1. Hi. The gform shortcode is deprecated. Can fields be pre-populated with the wpgform shortcode?

Leave a Reply