0
votes

I am trying to integrate with google spreadsheets but not sure if the workflow I have in mind is possible.

Here is the workflow:

  • A user chooses to add a spreadsheet to my webapp
  • He is redirected to a new google spreadsheet
  • Once he is finished creating/editing I need a way for the user to come back to my app and give it the id of the newly created spreadsheet so that I can embed/show it

The authentication part should be okay, but figuring out how to implement the last step is a problem.

I was initially thinking of adding a menu item to the spreadsheet using apps-script that would say something like "Save and Close" and would redirect to my app with the new spreadsheet id as a URL parameter. But it seems like it is not possible to install such a menu to all newly created scripts.

Any suggestions? Is the workflow even feasible?

2
Your "Save and Close" menu item is feasible, if you create a copy of a spreadsheet containing the menu script, rather than creating a new spreadsheet. - Mogsdad
How does the 'redirect' happen ? Perhaps, if you create it within your script, you can have the spreadsheet object and its id - Srik

2 Answers

0
votes

Menu might need authorization on first run. Ho avoid that, write on a cell your app url with the ss id as a parameter ? Id=xxxxxx User clicks the url to go to next step.

0
votes

A template might work, depends on your needs. You can create a spreadsheet with code and add it to google templates. Then when the template is used the code will run, letting the template add a custom menu. The user never sees any code. (Comment: I would like life to be easy for end users of google-apps-script. i.e. for non-programmers.)