[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.
Table of Contents
ToggleWhat 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.
Create New Script
Go to Tools->Script editor…
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:
Save Script
Save your script by clicking File > Save , and give your script a name.
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.
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.
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.
Submit the form.
After submitting data will appear in your spreadsheet.
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]
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.
Hi,
I will try to help you.
Did you install this plugin https://wordpress.org/plugins/forms-3rdparty-integration/ ?
Let me know if this help.
Regards,
Stan.
I got the same problem.
Please, use this Plugin link https://gravityplus.pro/gravity-forms-post-to-3rd-party/
You need to fill the form and they will send it to your email.
I just tested it and everything worked.
Let me know, if you will have additional questions!
Please, use this Plugin link https://gravityplus.pro/gravity-forms-post-to-3rd-party/
You need to fill the form and they will send it to your email.
I just tested it and everything worked.
Let me know, if you will have additional questions!
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?
Hi Lyse!
Looks like they changed something, I will resolve this and update article soon.
Please, use this Plugin link https://gravityplus.pro/gravity-forms-post-to-3rd-party/
You need to fill the form and they will send it to your email.
I just tested it and everything worked.
Let me know, if you will have additional questions!
Thank you
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
Hi Nolan!
Looks like they changed something, I will resolve this and update article soon.
Please, use this Plugin link https://gravityplus.pro/gravity-forms-post-to-3rd-party/
You need to fill the form and they will send it to your email.
I just tested it and everything worked.
Let me know, if you will have additional questions!
What Am I suposed to use in API field? this is a required field
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
Please, use this Plugin link https://gravityplus.pro/gravity-forms-post-to-3rd-party/
You need to fill the form and they will send it to your email.
I just tested it and everything worked.
Let me know, if you will have additional questions!
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.. 🙂
Hi Levi!
Looks like they changed something, I will resolve this and update article soon.
Please, use this Plugin link https://gravityplus.pro/gravity-forms-post-to-3rd-party/
You need to fill the form and they will send it to your email.
I just tested it and everything worked.
Let me know, if you will have additional questions!
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
I keep getting an error when trying to save and test the script. Anyone else having the same problem?
Missing ; before statement
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!
i followed this tutorial, but i don’t see the new entries in my sheet, is this updated to september 2020?
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?
Hello Brian,
Yes, you just need to link two different scripts to it where change the sheetName variable.
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.
Got it working. thanks for the great tuturial.
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.
Hello Lee,
What format do you want to have on your table?
Thank you Bro ,but following your steps dosent work for me ,can you help me
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.
Resolved. The problem was my G.S ID.