All Collections
Data & integrations
Google sheet
Two-way sync your formaloo with Google Sheets
Two-way sync your formaloo with Google Sheets
Updated over a week ago

Two-way sync of forms with Google Sheets helps you automatically update data in two systems – your form and your sheet – in real-time.

To start, open your Formaloo dashboard, and right-click your formaloo. Then select “View responses” and go to the “Integrations and webhooks” tab. Follow these steps to continue:

1- Sync your form with the Google Sheet

Click on the “Connect to Google Sheets” button. Sync your form with the sheet you want and save changes.

Then enable the “Two-way Formaloo – Google Sheet sync” option on the same pop-up window.

2-Add a trigger on Google sheet

Now you should set a script on the connected google sheet and add a trigger for it.

Open your sheet, and on the menu under the “Extensions” menu item, choose the “Apps Script” option.

Then, delete everything from the opened editor and paste the following script instead:

function formalooSyncOnEdit(e) { 
var range = e.range;
var spreadSheet = e.source;
var column = range.getColumn();
var row = range.getRow();
const url = "" const headers = { "x-api-key": "e2afd323b824a38e10a07d86ad5c527c2c007c0d" };
const formData = { "row": row, "column": column, "sheet_id": spreadSheet.getId() }; const options = { 'method': 'post', 'contentType': 'application/json', 'payload': JSON.stringify(formData), 'headers': headers }; UrlFetchApp.fetch(url, options);

Save changes from the save icon on the menu above the editor. After saving the function, go to the triggers part, and add a new trigger.

On the opened pop-up, change the “Select event type” field to “On edit”. Also, change the “Failure notification settings” field’s value to “Notify me immediately”. Then save the trigger.

After saving, it asks you to give access to the trigger so it can implement the updates. Give the access, and you’re done!

Once two-way sync is enabled, any changes made to the Google Sheet will be reflected in the form. For example, if a row is deleted from the sheet, the corresponding response will be removed from the form. Similarly, if a value is changed in the sheet, the corresponding value in the form will be updated.

When two-way syncing your form with Google Sheets, it’s important to note that it syncs the data, not the fields.

The two-way sync only applies to the data. If you add a new column to Google Sheets, it won’t automatically add a new field to your form. Therefore, changing the format of your Google Sheet or the form will affect the two-way sync’s performance.

So whenever you add a new column to your Sheet, ensure it’s added to your form as well. Also, if you add a new field to your form, make sure it exists on your Google Sheets as well. Read on to learn how you can do it.

How to add a new column/field in two-way sync

If you decide to add a new column to your Google Sheet or add a new field to your form, in order for your two-way sync to work, you should make sure it is applied to both parties.

First, create the field on your form and save the changes. Then create a new column after the last column of your Google Sheet and put the slug of the Formaloo field in front of the field’s name in parentheses.

Did this answer your question?