mermberfix logo x
The MemberFix Team’s got you covered.
Membership plugins

How to send data from GravityForms to Google Sheets

gf to google sheets

[et_pb_section fb_built=”1″ _builder_version=”3.23.3″ custom_padding=”5px|||||”][et_pb_row _builder_version=”3.25″ background_size=”initial” background_position=”top_left” background_repeat=”repeat” custom_padding=”5px|||||”][et_pb_column type=”4_4″ _builder_version=”3.25″ custom_padding=”|||” custom_padding__hover=”|||”][et_pb_text _builder_version=”4.4.6″ z_index_tablet=”500″]

Want to send your Gravity Forms submissions data to Google Sheets?

This article will show you a unique method for doing so that doesn’t rely on Zapier or other external services. 🙂

This is useful if you want to track orders, edit applications, or simply manage and share you form submissions data to a Google Sheet.

What you will need

1 – The GravityForms Plugin.

2 – Forms: 3rd Party Integration 

Install and activate this plugin.

(You can use this free plugin to send your data to almost all third-party APIs in Gravity Forms.)

3 – Script for Google Sheet (explained below).

Create Your Google Sheet

Add a header row.

Note: Don’t change the header row at any point afterwards.

Screenshot 1 - How to send data from GravityForms to Google Sheets

Create New Script

Go to Tools->Script editor…

Screenshot 2 - How to send data from GravityForms to Google Sheets

Add Script

Delete any data that is in the Script and copy and paste the script below instead:

function doPost(e) {   if (!e) return;   var sheetID = "GOOGLE_SPREADSHEET_ID";  // Replace this with the Google Spreadsheet ID  var sheetName = "Sheet1";       // Replace this with the sheet name inside the Spreadsheet   var status = {};   // Code based on Martin Hawksey (@mhawksey)'s snippet   var lock = LockService.getScriptLock();  lock.waitLock(30000);   try {     var sheet = SpreadsheetApp.openById(sheetID).getSheetByName(sheetName);    var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];     // Add the data and time when the Gravity Form was submitted    var column, row = [],      input = {        "timestamp": new Date()      };     for (var keys in e.parameter) {      input[normalize_(keys)] = e.parameter[keys];    }     for (i in headers) {      column = normalize_(headers[i])      row.push(input[column] || "");    }     if (row.length) {       sheet.appendRow(row);      status = {        result: "success",        message: "Row added at position " + sheet.getLastRow()      };     } else {      status = {        result: "error",        message: "No data was entered"      };    }   } catch (e) {     status = {      result: "error",      message: e.toString()    };   } finally {     lock.releaseLock();   }   return ContentService    .createTextOutput(JSON.stringify(status))    .setMimeType(ContentService.MimeType.JSON); } function normalize_(str) {  return str.replace(/[^\w]/g, "").toLowerCase();}

Be sure to replace the sheet ID and the sheet name.

The spreadsheet ID is the long sequence of characters between the slashes in the URL of the desired spreadsheet:

Screenshot 3 - How to send data from GravityForms to Google Sheets

Save Script

Save your script by clicking File > Save , and give your script a name.

Screenshot 4 - How to send data from GravityForms to Google Sheets

Run Script

Run the script by pressing the Play button icon in the menu.

A permission box should pop up, click continue and then allow.

Screenshot 5 - How to send data from GravityForms to Google Sheets Screenshot 6 - How to send data from GravityForms to Google Sheets

Deploy the script

Deploy the script as a Web App by clicking on Publish > Deploy as web app

1 – Project Version: Leave default or enter 1.0.0

2 – Execute the app as: Myself

3 – Who has access to the app: Anyone, even anonymous

4 – Click Deploy

5 – And then Copy the current web app URL from the confirmation screen.

This is now your API URL to use in the Post to 3rd Party API for Gravity forms.

Screenshot 7 - How to send data from GravityForms to Google SheetsScreenshot 8 - How to send data from GravityForms to Google SheetsScreenshot 9 - How to send data from GravityForms to Google Sheets

Create and set new Gravity Form

Create a new “Send to Third Party” feed for your GravityForms form by going to Forms > Your Form > Settings > Send to Third Party > Add New

Use the following settings.

Name: Any Name you choose

Method: POST

API URL: Paste the URL that you copied from the Google Script Web App

Authorization: None

Headers: Leave Blank

Format: Default

Map API Parameters to Form Fields:

In the first column, enter the column titles from your google sheet, they must match exactly. Select which form field you want mapped to that column in your google sheet via the dropdown.

Conditional Logic: Optional – you can add conditional login to this connection in order to limit which form entries get sent to your google sheet.

Now save the feed and submit a test form to see it work.

Screenshot 11 - How to send data from GravityForms to Google Sheets

Submit the form.

After submitting data will appear in your spreadsheet.

Screenshot 12 - How to send data from GravityForms to Google Sheets Screenshot 13 - How to send data from GravityForms to Google Sheets

As you can see, you can send data from GravityForms to Google Sheets in 10-15 minutes without having to spend any of your zaps or map fields in Zapier!

Video: Sending GravityForms Submissions to a Google Spreadsheet

Here’s the video version of this tutorial!

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

You may also enjoy...

WordPress based membership sites have certain requirements, and make use of certain applications that, in my experience, makes most of the popular hosting providers a poor choice.
Using Digital Access Pass and OptomizePress? Beware of hackers!
How To Build a Massively Successful Service-Based Business with Dan Norris
Shane is the co-founder of Thrive Themes, a conversion-focused WordPress themes and plugins business. He also maintains a blog that utterly fails to suck over at www.imimpact.com.
Subscribe
Notify of
guest
31 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
carlton
carlton
September 11, 2019 7:22 am

Hello, Thanks for the article! My individual form settings don’t show the “Send to Third Party” like your screenshot does. They show under gravity settings, but the form fields don’t auto populate.

Khandaker Mahfuz
Reply to  S
November 16, 2019 9:40 am

I got the same problem.

Lyse
April 17, 2020 12:39 am

I have the same problem where the Gravity Form does not show the 3rd part services item on its settings menu. I did install the recommended plugin in your post. Can you help figure this out please?

Lyse
April 17, 2020 12:39 am

Thank you

Nolan Alexander
Nolan Alexander
May 13, 2020 12:01 am

Hello, I have the same issue as the other comments: the Send to Third Party option isn’t showing up on the Gravity Forms settings. Thank you

Gabriel Coronado
Gabriel Coronado
Reply to  S
September 10, 2020 7:00 pm

What Am I suposed to use in API field? this is a required field

Nolan
Nolan
May 13, 2020 12:29 am

Hello, I have the same issue as the other comments: the Send to Third Party option isn’t showing up on the Gravity Forms settings. Thank you

Levi
May 17, 2020 8:03 pm

Can you cover on how to set up the 3rd Party Integration plugin?
Nothing I have done is getting it show up in the settings of my GF either.

Thank you for the great video.. 🙂

Robert R Koch
Robert R Koch
June 2, 2020 8:49 pm

I was able to get everything up and running but the data is not showing up on the Sheets side. Any suggestions for trouble shooting?
 
Thanks for creating this!

Rob
 

Last edited 4 years ago by Robert R Koch
Michael
Michael
June 4, 2020 10:44 pm

I keep getting an error when trying to save and test the script. Anyone else having the same problem?
Missing ; before statement

Al Anaq
Al Anaq
July 29, 2020 4:35 am

Greetings. I have an issue regarding the entry date & time. When I submit the form in website, the time is 2020-07-29 11:29 but in the entry inside Google Sheet it is shown 2020-07-29 03:29 which is 3 hours difference. I have checked the timezone settings for both WordPress & Google Sheet, both is the correct one which is GMT +8:00 Kuala Lumpur. Does anyone else have the same issue like this or can help me regarding this? Thank you very much!

Gabriel Coronado
Gabriel Coronado
September 11, 2020 5:15 am

i followed this tutorial, but i don’t see the new entries in my sheet, is this updated to september 2020?

Brian Keith
Brian Keith
Reply to  Gabriel Coronado
September 18, 2020 1:41 pm

Is there a way to set multiple sheets?

My site has multiple forms and I want to configure it to save the entries to a specific sheet# on the file and using the same script

Example:

Form 1
Data will be added to Sheet 1

Form 2
Data will be added to Sheet 2

is this possible?

Victor Barannik
Reply to  Brian Keith
December 27, 2020 1:18 pm

Hello Brian,

Yes, you just need to link two different scripts to it where change the sheetName variable.

Lee
Lee
January 23, 2021 4:59 pm

I am not able to see data being pushed to Google Sheets. I have tried many times with very simple form and it does not work.

Lee
Lee
Reply to  Lee
January 23, 2021 5:44 pm

Got it working. thanks for the great tuturial.

Lee
Lee
Reply to  Lee
January 24, 2021 3:49 pm

Hi, I have everything working and wanted to thank you. I am running into an issue where the list field in Gravity Forms sends the data like so: [{“Event”:”heart surgery”,”Date”:”May 2020″}]. I am wondering if there is a way to remove the formatting as I am grabbing the data or should i try and figure a way to filter in Google sheets? Thank you for your time.

Victor Barannik
Reply to  Lee
January 29, 2021 3:52 pm

Hello Lee,

What format do you want to have on your table?

ghazi
ghazi
February 19, 2021 9:04 pm

Thank you Bro ,but following your steps dosent work for me ,can you help me

Pat
Pat
July 21, 2021 4:45 pm

Hi, thank you for this tutorial.
I am not able to see data being pushed to Google Sheets. I have tried many times but the push is still not working.

Pat
Pat
Reply to  Pat
July 21, 2021 4:51 pm

Resolved. The problem was my G.S ID.