Created
November 7, 2017 16:01
-
-
Save bradland/41a4b088bfc3c2ba8d18f83ce4ae02bb to your computer and use it in GitHub Desktop.
Updates data URL from named range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.