---
title: "Send data to a Google Form via Apps Script"
author: "Phil Bainbridge"
date: 2021-08-18T08:16:16+00:00
modified: 2021-08-18T08:16:19+00:00
canonical_url: https://pulse.appsscript.info/p/2021/08/send-data-to-a-google-form-via-apps-script/
markdown_url: https://pulse.appsscript.info/p/2021/08/send-data-to-a-google-form-via-apps-script.md
categories:
  - "Beginner"
  - "Forms"
  - "Solutions"
tags:
  - "pbainbridge.co.uk"
featured_image: https://pulse.appsscript.info/files/2021/08/Prefill2BGoogle2BForm.png
description: "The following Google Apps Script is designed to submit specific data to a Google Form, by creating a prefilled URL. The reason for this was I needed some way of sending data from a number of individual Google Sheets (that I did not own) to one central location, but crucially it needed to be anonymised."
---

# Send data to a Google Form via Apps Script

![Send data to a Google Form via Apps Script](https://pulse.appsscript.info/files/2021/08/Prefill2BGoogle2BForm.png)

> Use Google Apps Script to create a prefilled URL of data that can be submitted to a Google Form.
> [https://www.pbainbridge.co.uk/2021/08/send-data-to-google-form-via-apps-script.html](https://www.pbainbridge.co.uk/2021/08/send-data-to-google-form-via-apps-script.html)Screenshot of Google Form questions

The following Google Apps Script is designed to submit specific data to a Google Form, by creating a prefilled URL. The reason for this was I needed some way of sending data from a number of individual Google Sheets (that I did not own) to one central location, but crucially it needed to be anonymised.

Sending the data directly to a Google Sheet includes version history both in the file and cell meaning it was not truly anonymous. Whereas sending the data through a Google Form and then on to the Response Sheet did strip away anything identifiable.

The logic behind this code is to [create a prefilled URL**](https://support.google.com/a/users/answer/9308781?hl=en) which contains answers to each of the Forms questions. Use the previous webpage link to learn how to create such a URL first so that you understand each question on a Form has a unique value.

Source: *[The Gift of Script: Send data to a Google Form via Apps Script*](https://www.pbainbridge.co.uk/2021/08/send-data-to-google-form-via-apps-script.html)

---

*Published by [Phil Bainbridge](https://pulse.appsscript.info/p/author/phillipbainbridge/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2021/08/send-data-to-a-google-form-via-apps-script/](https://pulse.appsscript.info/p/2021/08/send-data-to-a-google-form-via-apps-script/)*
