njfife
njfife

Reputation: 3575

Creating a Mobile User Interface for Google Spreadsheet

Is it possible to make an HTML interface for a spreadsheet that doesn't run inside the spreadsheet? Basically I want to use the spreadsheet as a simple database.

I can't seem to find a way to do it in the documentation. I got this to work this way:

var ss = SpreadsheetApp.getActive();

function onOpen() {
var html = HtmlService.createHtmlOutputFromFile('index');
ss.show(html);

That opens my page automatically when I load the sheet, which is not a bad way to have it work, but I would rather run it from a separate page without having to know it is looking at a spreadsheet.

Also, this script doesn't work on mobile browsers which is an issue.

Is what I want to do possible currently? I have been looking at the documentation for a while without a clear answer.

Upvotes: 0

Views: 1890

Answers (1)

AdamL
AdamL

Reputation: 24659

I believe you will be wanting to deploy your script as a web app, rather than a "container-bound" script inside a spreadsheet.

As there will be no spreadsheet inherently associated with the web app, you would need to use the openById() method rather than getActive().

Upvotes: 1

Related Questions