Skip to content

Instantly share code, notes, and snippets.

@the-paulus
the-paulus / categories.js
Created April 15, 2017 21:08
Google Sheet script that will convert cells A2:D1000 into a downloadable XML file.
function doGet() {
// The sheet that contains the category information.
var categoryDataSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Categories");
// The first row of the sheet that contains the categories' name, description, parent, banner image, and list image.
var categoryAttributes = categoryDataSheet.getRange("A1:D1").getValues();
// Range of rows and columns that contain the category information.
var categoryData = categoryDataSheet.getRange("A2:D1000").getValues();
// XML document object.
var document = XmlService.createDocument();
// Root element of the XML output.
@the-paulus
the-paulus / manufacturers.js
Created April 15, 2017 21:07
Google Sheet script that will convert cells A2:B1000 into a downloadable XML file.
function doGet() {
// The sheet that contains the manufacturer information.
var manufacturerDataSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Manufacturers");
// The first row of the sheet that contains the manufacturer's name and description.
var manufacturerAttributes = manufacturerDataSheet.getRange("A1:B1").getValues();
// Range of rows and columns that contain the manufacturer information.
var manufacturerData = manufacturerDataSheet.getRange("A2:B1000").getValues();
// XML document object.
var document = XmlService.createDocument();
// Root element of the XML output.
@the-paulus
the-paulus / products.js
Created April 15, 2017 21:05
Google Sheet script that will convert cells A2:N1000 into a downloadable XML file.
/* Main function for generating XML from spreadsheet. */
function doGet() {
// The sheet that contains the product information.
var productDataSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Products");
// The first row of the sheet that contains all the product attributes (e.g., Color, Weight, Collection, Name, etc.)
var productAttributes = productDataSheet.getRange("A1:N1").getValues();
// Range of rows and columns that contain the product information.
var productData = productDataSheet.getRange("A2:N1000").getValues();
// XML document object.
var document = XmlService.createDocument();

Keybase proof

I hereby claim:

  • I am the-paulus on github.
  • I am the_paulus (https://keybase.io/the_paulus) on keybase.
  • I have a public key whose fingerprint is 66E9 292D C084 9FD9 9F36 05E2 69C5 84CB E5CE EAC4

To claim this, I am signing this object: