Populate Gravity Forms with Google Sheets

Magically enhance your forms with dynamic field choices and values loaded directly from Google Sheets.

  1. A Peek Into GC Google Sheets and GP Populate Anything
  2. Getting Started
  3. Step 1 – Create a Cake Selection Form
  4. Step 2 – Set Up Populate Anything
    1. Select Your Sheet
    2. Set Templates and Filters

July 25th, 2024 Rewrote the article with a new solution consisting of GC Google Sheets and GP Populate Anything.

November 18th, 2021 Updated filter behavior to be case-insensitive to match the behavior of core Populate Anything object types.

“Oh, no! What am I to do? All my data is already perfectly organized in Google Sheets. I wish I had a way to make my forms automatically update…”

Worry not, friend! The wizards are here to help bring your data from Google Sheets directly to Gravity Forms. 🧙‘Tis a simple spell that combines GC Google Sheets and GP Populate Anything to save you database resources and time (having to do things twice just isn’t very magical).

Here’s how it works:

  • GC Google Sheets creates a connection between form and spreadsheet.
  • Then, Populate Anything summons your spreadsheet data to your form.

This wizardly combination unlocks a new level of teamwork. There’s no need to grant everyone access to WordPress: team members can update connected spreadsheets and see the changes reflected on the frontend.

And, what’s more: Google Sheets’ powerful features will be at your disposal when building with Gravity Forms. What a combo! 🙌

This article requires the GC Google Sheets connection and the GP Populate Anything perk.

Gravity Connect connects Gravity Forms to top-tier services. Gravity Perks enhances Gravity Forms to magical heights. Wombo combo indeed!

A Peek Into GC Google Sheets and GP Populate Anything

GC Google Sheets integrates Google Sheets with Gravity Forms. It allows entry data to be sent directly to your spreadsheets out-of-the-box. Edits to your entries will automatically sync, including removing rows for trashed or spammed entries. Oh, and it can create brand new spreadsheets too!

Now, to be able to pull data from Google Sheets to Gravity Forms, GC Google Sheets needs to be integrated with GP Populate Anything. It’s name doesn’t lie: it can populate any field with Posts, Users, Taxonomies, Terms, Form Entries, aaaaaand Google Sheets data!

Getting Started

First, make sure you have both GC Google Sheets and Populate Anything installed and activated. Then, follow our Populate Anything documentation to link your Google Account and connect your spreadsheet to Gravity Forms.

Once that’s all set up, it’s time for the fun part: let’s imagine you run a cake shop. 🎂

You use Google Sheets to keep track of recipes and ingredient inventory. For the sake of brevity, I’ve conjured this humble example:

Three Google Sheets columns with the following headers, in order: Name, Base, Topping.

See the headers for each column (Name, Base, Topping)? These will be useful later on!

To help your customers choose the best cake for their occasion, you decide to create a form that allows them to filter their choices based on different parts of the cake. When your form is complete, users will be able to select a Base and a Topping to, magically, receive a cake suggestion in the form of Name.

Time to dig in! 🍽️

Step 1 – Create a Cake Selection Form

Start building your form and include:

  • Choice fields for Base and Topping. (I’ll be using Radio Buttons.)
  • Text field for Name output.
Creating a cake selection using Gravity Forms

Step 2 – Set Up Populate Anything

Now, to summon data from your spreadsheet with Populate Anything!

Select Your Sheet

For this part, the process will be the same for all fields:

Go to the General tab of the Field Settings and enable:

  • “Populate choices dynamically” for the Choice fields.
  • “Populate value dynamically” for the Text field.

From there, select:

  • Type: Google Sheets
  • Spreadsheet: Your spreadsheet (Mine is named “Conjured Cakes.”)
  • Sheet: Your sheet (“Sheet1,” a classic.)
GP Populate Anything settings inside the field settings.

Although we are using the same spreadsheet and sheet here, you can actually pull data from different spreadsheets and sheets!

Set Templates and Filters

Still within “Populate choices dynamically,” you’ll select which columns from your sheet you want to pull data from. Here’s where those headers in the sheet will come in handy!

Let’s go field by field:

  1. “Choose your base”

We have two types of Bases and four types of Toppings, two different ones for each Base. This is our main parameter.

  • Choice Template:
    • Value: Base
    • Label: Base
  1. “Choose your toppings”

This is our secondary parameter. We only want to show Toppings that are available for the selected Base, so we’ll add a filter to this field.

  • Add Filter Group
    • Base is “Choose your base”
  • Choice Template:
    • Value: Topping
    • Label: Topping
Field settings for choosing a base and topping values.
  1. “And your cake is…”

This is where the suggestion will appear! Even though our options are pretty straightforward in this example, let’s add a filter to this field to be ready for when our cake selection grows.

  • Add Filter Group
    • Base is “Choose your base” +
    • Topping is “Choose your toppings”
  • Value Template
    • Value: Name
Field interface showing base and toppings, with filter groups.

And just like that, you’ve conjured a cake! More specifically, a form that allows users to conjure a cake based on bases and toppings they’ve selected.

the end result form showcasing conjured cakes as a result of toppings.

New whimsical flavors coming around? Just put them into your spreadsheet and watch them appear in your form!

Google Sheets spreadsheet indicates where the cakes and cake toppings are being populated from.

Now that was a piece of cake. 🍰

Let me tell you a little secret: these suggestions can be a sweet treat for you too! When customers submit the form, you might want to collect those generated suggestions back on your spreadsheet. This way, you can tally them up and see what people are choosing the most. To make this spell work both ways, check out our Two-Way Connect Gravity Forms with Google Sheets guide! 🍬📊

Comments

  1. D
    D January 28, 2022 at 10:26 pm

    Seems to only show 500 or so of thousands of records? is that expected? When I use ‘enhanced user interface’ to search a list of universities, it always fails to find values that are a long way down the list. Please can you advise, thanks!

    Reply
    1. Dario Space
      Dario Space December 6, 2021 at 9:27 am

      Hi Anna,

      There shouldn’t be any limit on the number of items that can be displayed in a dropdown.

      Best,

  2. CHIH WEN LIAO
    CHIH WEN LIAO November 16, 2021 at 3:58 am

    Even removing some relating plugins, Ver0.1.4 & 0.1.5 still show nothing under Forms » Settings, but get a new “Google Sheet” Type. No ways to input the JSON Key setting.

    Could it (Service Account JSON Key setting) possible be manually activated via snippet ? Thx

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff November 16, 2021 at 4:11 am

      Hi Chih,

      There is a special plugin that you’ll need to install and activate to use with the GP Populate Anything Perk to get the JSON Key Settings. You’ll find the plugin in this documentation above.

      Best,

    2. Dario Space
      Dario Space November 28, 2021 at 5:39 pm

      Hi Chih,

      When testing locally it seems to be working as expected.

      If you have an active Gravity Perks License, you can get in touch with us via our support form with your account email address and we’ll be happy to dig into this further.

      Cheers,

    1. Samuel Bassah
      Samuel Bassah Staff October 13, 2021 at 5:11 am

      Hi Tamra,

      I’m not completely sure, but if you can create an API for the Google Shared and a Google Sheet API, it may work. Could you give it a try and see if it works for you. In case it doesn’t work, you can get in touch with us via our support form with additional details so we take a look into this.

      Best,

  3. Pete Caine
    Pete Caine September 17, 2021 at 2:41 am

    Does this work the opposite way around? Can you populate Google Sheets from Gravity Form entries? I know if can be done through third parties but not directly via Gravity Forms.

    Reply
    1. Scott Ryer
      Scott Ryer Staff September 20, 2021 at 4:06 pm

      Hi Pete,

      We already replied in the ticket, but I wanted to follow up here also. We’re actually planning on creating a perk for this. We’re hoping to have it ready by the end of the year.

    1. Samuel Bassah
      Samuel Bassah Staff September 15, 2021 at 7:20 am

      Hi Veronique,

      Thanks for the kind words. Currently, this only works with Google Sheet API. I will pass your comment to our developers as a feature request.

      Best,

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.

Grab a bundle of free Gravity Forms plugins

Enter your email and receive our most popular free plugins and snippets, plus access to hundreds of others.

This field is for validation purposes and should be left unchanged.