Custom Function in Google Sheets Add-On

727 views Asked by At

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;
}
1

There are 1 answers

0
mhawksey On BEST ANSWER

Publishing a Google Add-on is a different processes to publishing a Chrome Web Store extension. Add-ons are also only in developer preview. This doesn't stop you publishing an add-on but it means that it first must be approved by Google. This page contains a form for submitting your add-on for approval as well as other information about the publication process.