Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@angelperezleon 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