Skip to content

Instantly share code, notes, and snippets.

@bradland
Created November 7, 2017 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradland/41a4b088bfc3c2ba8d18f83ce4ae02bb to your computer and use it in GitHub Desktop.
Save bradland/41a4b088bfc3c2ba8d18f83ce4ae02bb to your computer and use it in GitHub Desktop.
Updates data URL from named range.
function onOpen(e) {
SpreadsheetApp.getUi()
.createMenu('Data Mgmt')
.addItem('Refresh Pipeline Data', 'getData')
.addToUi();
}
function getData() {
// 'Data Import' sheet uses IMPORTDATA() function to pull CSV data from Pipeline application. This function
// only updates once an hour by default. This formula is used to alter the import URL so that the function
// will trigger on a pre-determined interval.
var ss = SpreadsheetApp.getActiveSpreadsheet();
var url = ss.getRangeByName("DataImportURL").getValue();
var url_field = ss.getRangeByName("DataImportURLRef").setValue(url + "&gs_import=" + Utilities.formatDate(new Date(), "GMT", "yyyyMMddHHmmss"));
}
@angelperezleon
Copy link

angelperezleon commented Nov 17, 2017

Hi brad,

Nice script, used it and works perfectly.. the only step i needed was to generate the p12 file to then use to import into IE cert store.
Wondering if you are able to implement the following as my scripting will fall short of looking nice compare to what you have done here.

# Generate p12 cert file
# openssl pkcs12 -inkey key.pem -in cert.pem -export -out certificate.p12

#openssl pkcs12 -in certificate.p12 -noout -info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment