# ODK Central to Google Sheets

**URL:** <https://forum.getodk.org/t/odk-central-to-google-sheets/42072>\
**Category:** Development\
**Created:** [June 27, 2023, 10:35am UTC](https://forum.getodk.org/t/odk-central-to-google-sheets/42072 "2023-06-27T10:35:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ODK-MAC](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/odk-mac/32/20698_2.png) [@ODK-MAC](https://forum.getodk.org/u/ODK-MAC)\
**Post date:** [June 27, 2023, 10:35am UTC](https://forum.getodk.org/t/odk-central-to-google-sheets/42072/1 "2023-06-27T10:35:32Z")

</div>

What is the simplest way to pull data directly from ODK Central to Google Sheets?

---

<div class="post-metadata">

**Author:** ![Sadiq\_Khoja](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/sadiq_khoja/32/3719_2.png) [@Sadiq\_Khoja](https://forum.getodk.org/u/Sadiq_Khoja)\
**Post date:** [June 27, 2023, 3:02pm UTC](https://forum.getodk.org/t/odk-central-to-google-sheets/42072/2 "2023-06-27T15:02:52Z")

</div>

Hi Tony,

Currently there is no out-of-the-box way to pull data into Google Sheets. Google has recently added `Data Connectors` for BigQuery and Looker, they might build a connector for general APIs, till then you have two options:

1. Manually export CSV from Central and import it in Google Sheets
2. Rely on third-party add-ons

> ⚠ I don't endorse any third-party add-ons, use it at your own risk. Make sure to read the terms and conditions + privacy agreement before installing any add-ons

I have just tried [API Connector](https://workspace.google.com/marketplace/app/api_connector/95804724197), it does the job

 ![image](https://getodk.b-cdn.net/uploads/default/original/3X/a/f/afa7504af3f473e7140681593240f0b0f41ca338.png)

---

<div class="post-metadata">

**Author:** ![ODK-MAC](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/odk-mac/32/20698_2.png) [@ODK-MAC](https://forum.getodk.org/u/ODK-MAC)\
**Post date:** [July 24, 2023, 8:14am UTC](https://forum.getodk.org/t/odk-central-to-google-sheets/42072/3 "2023-07-24T08:14:32Z")

</div>

HI. Thanks for your reply. Would it be possible to do a quick step by step guide to link API Connector to Central an pull the headers and data in?

Thanks

---

<div class="post-metadata">

**Author:** ![Tyler\_Depke](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/tyler_depke/32/17598_2.png) [@Tyler\_Depke](https://forum.getodk.org/u/Tyler_Depke)\
**Post date:** [July 17, 2025, 2:48pm UTC](https://forum.getodk.org/t/odk-central-to-google-sheets/42072/4 "2025-07-17T14:48:59Z")

</div>

Something that I thought would take some serious time was [solved by chatGPT in one prompt](https://chatgpt.com/share/68790ace-8b38-8003-b3fa-bd0b4677a5bb).

Step by Step Instructions

1. Open a new Google Sheet
2. Extensions --\>App Script
3. Copy and Paste the following code in code.gs
4. Replace the 4 const values in lines 2-5 with your values
5. Run Code and approve permissions
6. Check your google sheet and celebrate! 🙌

I haven't used this extensively but it works for my basic test!

```auto
// CONFIGURATION
const ODK_URL = 'https://your-odk-server.org/v1/projects/1/forms/myform/submissions.csv';
const ODK_USERNAME = 'yourusername';
const ODK_PASSWORD = 'yourpassword';
const SHEET_NAME = 'ODK Data'; // Sheet name to write to

function importODKData() {
  const encodedCreds = Utilities.base64Encode(ODK_USERNAME + ':' + ODK_PASSWORD);

  const options = {
    method: 'get',
    headers: {
      'Authorization': 'Basic ' + encodedCreds
    },
    muteHttpExceptions: true
  };

  const response = UrlFetchApp.fetch(ODK_URL, options);
  const code = response.getResponseCode();

  if (code !== 200) {
    Logger.log("Error fetching data: " + code + " - " + response.getContentText());
    return;
  }

  const csvData = Utilities.parseCsv(response.getContentText());
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(SHEET_NAME) || 
                SpreadsheetApp.getActiveSpreadsheet().insertSheet(SHEET_NAME);

  sheet.clearContents();
  sheet.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData);
}

```

> **[ChatGPT - Import ODK Data Script](https://chatgpt.com/share/68790ace-8b38-8003-b3fa-bd0b4677a5bb)**
>
> Shared via ChatGPT
