CSV Getter Docs
CSV GetterLoginSign Up
  • Welcome
  • What is CSV Getter?
  • The Export URL
  • Data Sources
    • Connect Airtable
    • Connect Notion
    • Connect Google Sheets
    • Upload Data
  • Destinations
    • Connect to Dropbox
    • Connect to Google Drive
  • Exporting
    • Export Airtable
    • Export Airtable (With Airtable URL)
    • Export Airtable (via API)
    • Export Notion
    • Export Google Sheets
    • Export Uploaded Data
  • Automations
    • Export to Excel (Windows)
    • Export to Google Sheets (Drive)
    • Export to Google Sheets (Direct)
    • Export to Dropbox
    • Export to JSON
    • Export to XML
  • Airtable
    • Linked Records and Lookup Fields
    • Export Shared Airtable View
  • Platform Features
    • URL Parameters
    • The "Type" Parameter
    • The "SQL" Parameter
    • Email Notifications
    • Extract JSON Property
    • Embeddable Wordpress HTML
  • Misc
    • Zapier Code Example
    • Google App Script Snippet
  • Custom Chat GPT Code
Powered by GitBook
On this page

Was this helpful?

  1. Misc

Google App Script Snippet

Use this App Script snippet to import CSV Getter data into a Google Sheet. You can set Scheduled Google App Script triggers to have a regular backup of your data.

function csvGetter() {

// URL of the CSV file [REPLACE WITH YOURS]

var url = "<YOUR EXPORT URL>";

// Fetch the CSV file

var response = UrlFetchApp.fetch(url);

// Get the contents of the file as a string

var csvString = response.getContentText();

// Convert the CSV string to a 2D array

var csvData = Utilities.parseCsv(csvString);

// Get the active sheet

var sheet = SpreadsheetApp.getActiveSheet();

// Clear the existing data in the sheet

sheet.clear();

// Write the data from the CSV file to the sheet

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

}

PreviousZapier Code ExampleNextCustom Chat GPT Code

Last updated 6 months ago

Was this helpful?