I have a complicated Google Form I've already written. While it could be reimplemented in Caldera Forms, this would be time-consuming, and Caldera Forms is no longer being developed. Is there a way to integrate Google Forms with CiviCRM?

1 Answer 1


[Note: With apologies to Jeff Goldblum, I was so preoccupied with whether I could do this, I didn't stop to think if I should. See the bottom for some caveats.]

You can do this by adding a Google Script and trigger to your Google Form, and installing Form Processor on the CiviCRM side.

Configuring Form Processor is out of scope of this question - there are documentation and blog posts available to explain that. However, no documentation exists for the Google side.


  • From the Google Forms editing screen, click the More menu (three vertical dots) and select Script Editor.
    • This won't appear if you're too zoomed in.
  • Paste the following code into the editor and press Save (latest version on Github):
 * @OnlyCurrentDoc

function onFormSubmit(event) {

  // Set the values on these four lines for your Form Processor and site.
  var url = '<API3 REST Endpoint here>';
  var api_key = '<api key here>';
  var site_key = '<site key here>';
  var form_processor_machine_name = '<machine name of Form Processor here>';

  // Don't modify anything below this line.
  var submission = {};
  var responses = event.response.getItemResponses();
  for (var i = 0; i < responses.length; i++) {
    // Convert all non-alphanumeric values in the title to underscores, lowercase as well.
    title = responses[i].getItem().getTitle().replace(/[\W]+/g,"_").toLowerCase();
    submission[title] = responses[i].getResponse();

  var payload = { 
    "entity": "FormProcessor",
    "action": form_processor_machine_name,
    "json": JSON.stringify(submission),
    "api_key" : api_key,
    "key": site_key,
  var options = {
    "method" : "post",
    "payload" : payload,
    "muteHttpExceptions" : true,

  // Fire the webhook.
  var response = UrlFetchApp.fetch(url,options);
  • Modify the indicated lines at the top of the script to add these values:

    • The URL of your REST endpoint (varies by CMS and by CiviCRM version; check the REST Endpoint documentation);
    • The API key of a user with the necessary permission specified by your Form Processor configuration;
    • The site key (can be found in civicrm.settings.php);
    • The machine name of your Form Processor instance (can be found in the configuration).
  • In the Google Script editor left navigation, click the Triggers tab, click Add a Trigger and configure it as follows:

    • Choose which function to run: onFormSubmit
    • Which runs at deployment: Head
    • Select event source: From form
    • Select event type: On form submit.
    • NOTE: If you create the trigger before adding the code, Google won't ask you to authorize the necessary scopes. Create the trigger last.

Now your forms will send the data to CiviCRM when they're submitted! To find the names of the inputs to configure Form Processor, do a test form submission, then in Google Script editor, click the Executions tab. The script will log the payload to Form Processor, and you can easily see the names of the fields as CiviCRM will see them.

Caveats This makes for an extremely brittle solution.

  • Google Forms doesn't have "machine names" for fields - so changing a label requires a change in Form Processor or that field isn't processed.
  • Multiple choice values must match EXACTLY in Google and Civi. Punctuation and case included.
  • Changing your multiple-choice options in Google will cause a form to crash if that option doesn't also change in Civi.
  • Multiple choice values changed in Civi won't crash the form, but obviously need to be replicated in Google.

In short - this is an inferior solution to, say, Civi Form Builder. It only makes sense if you have an existing Google Form that is embedded in your workflows, which changes rarely if ever.

  • Very nice, @Jon. Thanks for sharing this useful documentation.
    – Joe Murray
    Commented May 4, 2021 at 18:07
  • Jon, how could I modify your code above so that instead of submitting the option text in a multiple-choice question (call this the script submits a "value" derived from the choice, e.g., if the options are "London", "Wight", and "West Sussex" and the user chooses "Wight" then the value "2" will be sent to the form processor. I can see this isn't a whole lot different from the manipulation you do on GitHub for option text "Yes" and "No" but I'm not knowledgeable of this script language and so can't work out how to make this modification. Your script is super useful. Thank you.
    – gillenpj
    Commented Jan 28, 2023 at 21:51
  • 1
    @gillenpj You couldn't do that without hardcoding quite a bit into the script - but it's pretty straightforward on the Form Processor side. Make sure you're passing it to an "Option Group" input, and then select the "Use label as value" checkbox. It will convert it automatically for you. Commented Jan 29, 2023 at 18:17
  • 1
    Jon, this is awesome! Thank you so much. It works a charm.
    – gillenpj
    Commented Jan 29, 2023 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.