Where I missed when I published the add-on

42 views
Skip to first unread message

Alex

unread,
Oct 30, 2019, 5:30:45 AM10/30/19
to Google Apps Script Community
Hi!

Please help me to understand what I was wrong.

I've published an add-on for Sheets which doesn't require any scope and adds a couple of functions.

But the new user after installation must manually enable these formulas for his Table. Why is this happening? Can this be somehow automated for new users?

1572427690655.png


Sincerely, Alex.


--Hyde

unread,
Oct 30, 2019, 6:02:25 AM10/30/19
to Google Apps Script Community
Hi Alex,

It sounds like your add-on consists of spreadsheet custom functions. My understanding is that custom functions only get run when the user has authorized the add-on, and simply calling a custom function from a spreadsheet formula does not trigger the authorization dialog box.

The easiest solution is probably to add a menu item like Add-ons > Alex's add-on > Start. The function that gets run by the menu item does not need to do anything but could open an info sidebar or something like that. The point is that the user can choose the menu item to run a function interactively, which is enough to trigger the authorization flow. If no authorization is required, nothing happens, but if some scopes are required, the authorization dialog box gets shown.

It is likely that your add-on requires at least some scopes. You can check that in Script editor > File > Project properties > Scopes. To make the authorization dialog box less scary, remember to include the @onlycurrentdoc pragma in a Javadoc comment someplace in your script.

Cheers --Hyde

Alex

unread,
Oct 31, 2019, 1:31:11 AM10/31/19
to Google Apps Script Community
Hi!

Thanks for the suggestion!

But the issue is still there.


Before I'm asking I didn't use any scopes. Really. I grabbed the Sheet settings through
this['Spreadsheet' + 'App'].getSpreadsheetLocale()

It seems it's a common problem. Another our add-on https://gsuite.google.com/u/0/marketplace/app/formulas_by_top_contributors/515924842729?hl=en has same behavior.

We have to teach our users to use this https://numbertext.contributor.pw/en/issues.

Best, Alex.

--Hyde

unread,
Oct 31, 2019, 4:54:43 AM10/31/19
to Google Apps Script Community
Hi Alex,

OK, understood. I agree that custom function add-ons should either (1) automatically link custom functions so that they work without authorization, or (2) automatically trigger the authorization flow when a user evaluates a formula that includes a custom function.

You may want to create a ticket about this in the issue tracker. If you do, please note the ticket URL in this community thread so that others can star it. I suspect that this issue may be related to but different from issue 36763437.

Cheers --Hyde

Alex

unread,
Oct 31, 2019, 8:38:27 AM10/31/19
to Google Apps Script Community
Hi!

Thanks for you support.

As regards a ticket I'd like to think about this more for create a good feature request. I'll leave the URL here.

Best,
Alex.
Reply all
Reply to author
Forward
0 new messages