javascript - Google Apps Script: set note from custom function -
i'm struggling following issue:
have spreadsheet responsible tracking stock market investments. calls external service csv current prices.
so, there function customfunction()
calls urlfetchapp
, returns current price of item. i'd add note cell has been called from, containing current datetime. this:
function customfunction() { //get price csv var url = "http://sth.com"; var csv = urlfetchapp.fetch(url); var result = utilities.parsecsv(csv); var currentvalue = parsefloat(result[1][6]); //set note spreadsheetapp.getactivesheet().getactivecell().setnote("hey, i'm note datetime"); //return value can set cell value return currentvalue; }
i calling function cell e21 (value =customfunction()
). , works planned, except line supposed set note. sure correct cell (tested returning a1notation value). error:
error: not have permission call setnote
does know if it's possible set note cell calls custom function function? or maybe have idea of workaround, catching moment function reloades new data , using trigger?
your problem due permission limitations:https://developers.google.com/apps-script/execution_custom_functions#permissions
function spreadsheetapp.getactivesheet().getactivecell() not anonymous , can't used here. unfortunately don't know efficient workaround
Comments
Post a Comment