0

Update: Question regarding a proper distribution mechanism in the first place: Publish and distribute a Google Sheets with App Scripts so user gets private copy of sheet

I'm developing an app inside a Google Sheet for which the delivery is basically just hard copy / forking. Does Google Docs have a forking mechanism that counts or tracks forks in any way?

Alternately is there a way to hack this? I could give the user an optional link to register (i.e. Google form) their sheet.

Community
  • 1
  • 1
djechlin
  • 59,258
  • 35
  • 162
  • 290
  • To set/save user and application data, Properties Service can be used. It provides persistent data storage either in the document (Sheet in this case) or in the Script or for the User. There is no "one time installation" event except for Add-ons. If you don't want to use an Add-on, you would need to check a saved setting somewhere to determine whether that account had "installed" the Sheet. With an Add-on, you would probably use Script Properties to save basic info like that. But if every account has a copy of the Sheet, there is no central script. – Alan Wells Feb 18 '17 at 13:58
  • @SandyGood would the "fork/copy" model even be the way to go about this? the app idea is for the user to build out their own list of contacts etc. so of course they need to privately own it. I really don't see the right distribution model though, besides a popup dialog saying "thanks for visiting this example spreadsheet! please click "copy" to make your own copy and get started". which is hackish and problematic – djechlin Feb 19 '17 at 01:31
  • @SandyGood http://stackoverflow.com/questions/42322769/publish-and-distribute-a-google-sheets-with-app-scripts-so-user-gets-private-cop is the more proper question I should be asking. – djechlin Feb 19 '17 at 01:45
  • With an Add-on, the user owns whatever document (Doc, Sheet, Form) that the Add-on is installed to. If there is lots of formatting, styling, headers and formulas to add to the spreadsheet, the Add-on would need to build all of that, or somehow copy and paste it from your template into their spreadsheet. You could build your own Web App that "installs" the spreadsheet. Only you can determine whether the extra work is worth the more elegant solution. – Alan Wells Feb 19 '17 at 01:50

1 Answers1

0

There's no real forking of app script projects, but for the delivery system you describe, google app add-ons do the trick

See the doc here

You can deploy and app for all users of the g Suite domain or through a google group or finally to a specific list of users defined by you

  • is an add-on linkable? will the add-on just unpack the spreadsheet from script data? – djechlin Feb 19 '17 at 01:32
  • Yes you have installation links for the add-on. What it does is installs the script in the users sheet, so you don't need to have the original script attached to the spreadsheet (a la copy paste) . The script is invisible to the end user and is triggered by the end user(at least installation) – Juan Diego Antezana Feb 20 '17 at 09:19