I'm trying to create a Custom Function for Google Sheets as an add-on.
Everything works fine in my spreadsheet, and I also can download it via Web chrome store with the link Google provides me.
The only issue I have, is can't make the custom function work via the Google Sheets add-on store.
Don't know if I have to put further info in the manifest.json
file, or do something else.
My app is registered, it has no connection to external services, and it only uses the usual javascript functions to split a string object.
Here is the code structure:
function onOpen(e) {
SpreadsheetApp.getUi().createAddonMenu()
.addItem('Start', 'use')
.addToUi();
}
/**
* Enables the add-on on for the current spreadsheet (simply by running) and
* shows a popup informing the user of the new functions that are available.
*/
function use() {
var title = "Example";
var message = "The Function GETID is now available in this spreadsheet";
var ui = SpreadsheetApp.getUi();
ui.alert(title, message, ui.ButtonSet.OK);
}
function onInstall(e) {
onOpen(e);
}
/**
* example
* @param {string} input the example URL.
* @return The example URL.
* @customfunction
*/
function GETID(URL) {
return 'example '+URL;
}