# How to Pre-fill Google Forms

- Link: https://cagrimmett.com/2016/07/07/autofill-google-forms/
- Published: 2016-07-07T04:00:00-04:00
- Author: Chuck Grimmett

Did you know that you can pre-fill Google Forms based on a URL? Did you also know
that if you have a basic example you can automate it with a database and send personalized
forms?

### General Instructions

 1. On your form, click the vertical ellipses in the upper right corner to reveal the
    menu.
 2. Click âGet pre-filled linkâ ⌊Get pre-filled link⌉
 3. This shoots you over to a page where you can fill in the fields you want pre-filled
    and it will generate a URL for you. Copy this. If you want the link you send out
    to everyone to have the same pre-filled info, your work is done. Send the link 
    out!

### How you might automate it

[Here is my example form](https://docs.google.com/forms/d/1nuxTbnUGkTaZw1uGIXXgqfx3hYRi3ZaPahdwDNEgy3Q/viewform).
Once I went through the above steps to get a pre-filled link, here is what I got:

https://docs.google.com/forms/d/1nuxTbnUGkTaZw1uGIXXgqfx3hYRi3ZaPahdwDNEgy3Q/viewform?
entry.2005620554=Chuck&entry.1045781291=cagrimmett@gmail.com&entry.1065046570=308
+Negra+Arroyo+Lane,+Albuquerque,+NM+87114&entry.1166974658=281-330-8004&entry.839337160
=This+is+so+useful!

The stuff we are looking for is between the â=â and â&â signs:

https://docs.google.com/forms/d/1nuxTbnUGkTaZw1uGIXXgqfx3hYRi3ZaPahdwDNEgy3Q/viewform?
entry.2005620554=`Chuck`&entry.1045781291=`cagrimmett@gmail.com`&entry.1065046570
=`308+Negra+Arroyo+Lane,+Albuquerque,+NM+87114`&entry.1166974658=`281-330-8004`&
entry.839337160=`This+is+so+useful!`

As you can see, those are the items I filled in on my own. How might one automate
this, then? Here are a few suggestions:

 1. Using [handlebars](http://handlebarsjs.com) or [Liquid](https://github.com/shopify/liquid/wiki/Liquid-for-Designers),
    fill them in with the appropriate expressions and use the appropriate objects to
    fill them in: _https://docs.google.com/forms/d/1nuxTbnUGkTaZw1uGIXXgqfx3hYRi3ZaPahdwDNEgy3Q/
    viewform?entry.2005620554=`{{name}}`&entry.1045781291=`{{email}}`&entry.1065046570
    =`{{address}}`&entry.1166974658=`{{phone}}`&entry.839337160=`{{comments}}`_
 2. Using PHP, you might assign variables for these items and fill them in from your
    database with a select statement: _https://docs.google.com/forms/d/1nuxTbnUGkTaZw1uGIXXgqfx3hYRi3ZaPahdwDNEgy3Q/
    viewform?entry.2005620554=`$name`&entry.1045781291=`$email`&entry.1065046570=`$
    address`&entry.1166974658=`$phone`&entry.839337160=`$comments`_
 3. On Mailchimp, youâd have to use [Merge Tags](http://kb.mailchimp.com/merge-tags/using/getting-started-with-merge-tags):
    _https://docs.google.com/forms/d/1nuxTbnUGkTaZw1uGIXXgqfx3hYRi3ZaPahdwDNEgy3Q/viewform?
    entry.2005620554=`*|name|*`&entry.1045781291=`*|email|*`&entry.1065046570=`*|address
    |*`&entry.1166974658=`*|phone|*`&entry.839337160=`*|comments|*`_

Note: Make sure you are [URL encoding](http://www.w3schools.com/tags/ref_urlencode.asp)
things with weird characters and spaces like an address. Example: `308+Negra+Arroyo
+Lane,+Albuquerque,+NM+87114` vs `308 Negra Arroyo Lane, Albuquerque, NM 87114`

Completion of the code in 1, 2, and 3 is an instruction left to the reader. Iâ
m assuming that if you want to do something like generate thousands of personalized
URLs to a form, you probably already have a database and know how to use it. I hope
this guides you in the right direction! [Email me](https://cagrimmett.com/about/)
[Archived Link](http://web.archive.org/web/20130711045934/http://about) if you want
some help.

## Comments

### By: John Kruse

- Link: https://cagrimmett.com/2016/07/07/autofill-google-forms/#comment-1312
- Published: 2020-12-09T13:45:58-05:00

I am prepopulating from an Excel spreadsheet. The prepopulate fields are more than
256 characters. Any way to get around that?

Loading...

### By: Chuck Grimmett

- Link: https://cagrimmett.com/2016/07/07/autofill-google-forms/#comment-1313
- Published: 2020-12-09T13:51:31-05:00

To be honest, I’m not sure! I haven’t ran into that problem before. Where in the
process are you encountering the character limit issue?

Loading...

### By: John Kruse

- Link: https://cagrimmett.com/2016/07/07/autofill-google-forms/#comment-1314
- Published: 2020-12-09T13:54:30-05:00

Thank you for responding.
 I prepopulate 5 fields of street addresses and the last
address gets trunked when the number of characters exceed 256\.

Loading...

### By: Chuck Grimmett

- Link: https://cagrimmett.com/2016/07/07/autofill-google-forms/#comment-1315
- Published: 2020-12-09T14:40:56-05:00

Is is trunked in the URL that is generated or in the form field? Is it possible 
that the field you are using in Google Forms has a character limit?

Loading...

### By: John Kruse

- Link: https://cagrimmett.com/2016/07/07/autofill-google-forms/#comment-1316
- Published: 2020-12-09T14:48:10-05:00

Interesting…
 Can I send the form to you and the Excel string that is supposed to
feed it?

Loading...

### By: Chuck Grimmett

- Link: https://cagrimmett.com/2016/07/07/autofill-google-forms/#comment-1317
- Published: 2020-12-09T14:48:41-05:00

Sure! [chuck@grimmett.co](https://cagrimmett.com/2016/07/07/autofill-google-forms/chuck@grimmett.co#comment-1317)

Loading...

### By: Why blog?

- Link: https://cagrimmett.com/thoughts/2022/04/26/why-blog/
- Published: 2022-05-09T15:13:19-04:00

This Article was mentioned on [cagrimmett.com](https://cagrimmett.com/thoughts/2022/04/26/why-blog/)

Loading...