David Tolioupov
David Tolioupov

Reputation: 173

Adding google apps script though google API?

I am writing a program that creates a new spreadsheet, then exports data from our servers to this spreadsheet using Google API. Then the user should edit this data and reupload it back to our server.I would like to add data validations on some fields and also freeze the top row. I understand this can only be achieved through scripts and not though Google Spreadsheet API. My question: is it possible to attach a script when I create a spreadsheet? If not, are there other ways to achieve my goals? Thanks!!!

Upvotes: 0

Views: 260

Answers (1)

Henrique G. Abreu
Henrique G. Abreu

Reputation: 17752

There's no way to insert or modify any script on an existing spreadsheet via any API.

But there's a good workaround for those who are creating a new spreadsheet, like you. Instead of creating a new spreadsheet you can copy a blank one that already has the desired script in it, effectively creating new spreadsheets with scripts in it.

In your case this workaround may not even be necessary. Scripts attached to any spreadsheet (or site) can open any spreadsheets that you have access normally, they do not need to be inserted on the target document.

So, if all you want to do is some formatting before handling the file to the user, you don't need to insert your script in it.

Upvotes: 1

Related Questions